lkml.org 
[lkml]   [2022]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 4/6] scsi: pm8001: Use sas_task_find_rq() for tagging
From
On 04/10/2022 06:53, Hannes Reinecke wrote:
>> -    void *bitmap = pm8001_ha->tags;
>> +    void *bitmap = pm8001_ha->rsvd_tags;
>>       unsigned long flags;
>>       unsigned int tag;
>>       spin_lock_irqsave(&pm8001_ha->bitmap_lock, flags);
>> -    tag = find_first_zero_bit(bitmap, pm8001_ha->tags_num);
>> -    if (tag >= pm8001_ha->tags_num) {
>> +    tag = find_first_zero_bit(bitmap, PM8001_RESERVE_SLOT);
>> +    if (tag >= PM8001_RESERVE_SLOT) {
>>           spin_unlock_irqrestore(&pm8001_ha->bitmap_lock, flags);
>>           return -SAS_QUEUE_FULL;
>>       }
>>       __set_bit(tag, bitmap);
>>       spin_unlock_irqrestore(&pm8001_ha->bitmap_lock, flags);
>> +
>> +    /* reserved tags are in the upper region of the tagset */
>> +    tag += pm8001_ha->shost->can_queue;
>>       *tag_out = tag;
>>       return 0;
>>   }
> Can you move the reserved tags to the _lower_ region of the tagset?
> That way the tag allocation scheme matches with what the block-layer
> does, and the eventual conversion to reserved tags becomes easier.

Yeah, I agree that having a scheme which matches the block layer would
be good for consistency and I will make that change, but I am not sure
how it helps conversion to reserved tags.

Thanks,
John

\
 
 \ /
  Last update: 2022-10-04 09:37    [W:0.068 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site