All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: dougg@torque.net
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/1] sg: SG_IO 64k page fix
Date: Tue, 19 Sep 2006 10:47:38 -0500	[thread overview]
Message-ID: <4510111A.6040706@us.ibm.com> (raw)
In-Reply-To: <45100E21.3070604@torque.net>

Douglas Gilbert wrote:
> Brian King wrote:
>> The problem appears to be in the definition of SG_SCATTER_SZ. The comment
>> states that it must be a power of 2, must be less than PAGE_SIZE * 32,
>> and must be at least as large as PAGE_SIZE. For 64k pages, this is not
>> true. Increasing SG_SCATTER_SZ to 64k fixed the oops in my configuration.
>>
>> Signed-off-by: Brian King <brking@us.ibm.com>
>> ---
>>
>>  linux-2.6-bjking1/include/scsi/sg.h |    2 +-
>>  1 files changed, 1 insertion(+), 1 deletion(-)
>>
>> diff -puN include/scsi/sg.h~sg_large_page_support include/scsi/sg.h
>> --- linux-2.6/include/scsi/sg.h~sg_large_page_support	2006-09-19 09:24:06.000000000 -0500
>> +++ linux-2.6-bjking1/include/scsi/sg.h	2006-09-19 09:27:00.000000000 -0500
>> @@ -238,7 +238,7 @@ typedef struct sg_req_info { /* used by 
>>  #define SG_GET_ACCESS_COUNT 0x2289  
>>  
>>  
>> -#define SG_SCATTER_SZ (8 * 4096)  /* PAGE_SIZE not available to user */
>> +#define SG_SCATTER_SZ (16 * 4096)  /* PAGE_SIZE not available to user */
>>  /* Largest size (in bytes) a single scatter-gather list element can have.
>>     The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on
>>     i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported
>> _
> 
> Brian,
> Yes that obviously needs to be fixed. However the patch
> is a bit fragile, for example if some architecture decides
> to have an option for 128 KB page size or larger.

I agree. 

> I've got a patch to add a sysfs/boottime attribute for
> setting max_scatter_elem_sz. If that logic made an additional
> check, adjusting max_scatter_elem_sz up to PAGE_SIZE if
> necessary. The SG_SCATTER_SZ define could stay as is,
> apart from an additional note that it will be forced to
> PAGE_SIZE if necessary.

You forgot to attach the patch ;) Is this something you plan
to be submitting soon?

Thanks,

Brian

-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

      reply	other threads:[~2006-09-19 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19 14:45 [PATCH 1/1] sg: SG_IO 64k page fix Brian King
2006-09-19 15:34 ` Douglas Gilbert
2006-09-19 15:47   ` Brian King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4510111A.6040706@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.