public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Kai Makisara <Kai.Makisara@kolumbus.fi>
Cc: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de>,
	linux-scsi@vger.kernel.org
Subject: Re: After memory pressure: can't read from tape anymore
Date: Tue, 30 Nov 2010 19:24:25 +0200	[thread overview]
Message-ID: <4CF53349.10509@panasas.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1011301853300.9731@kai.makisara.local>

On 11/30/2010 07:04 PM, Kai Makisara wrote:
> On Tue, 30 Nov 2010, Boaz Harrosh wrote:
> 
>> On 11/30/2010 06:23 PM, Kai Makisara wrote:
>>> On Tue, 30 Nov 2010, Boaz Harrosh wrote:
>>>
>>>> On 11/30/2010 03:31 PM, Lukas Kolbe wrote:
>>>>> On Mon, 2010-11-29 at 19:09 +0200, Kai Makisara wrote:
>>>>>
>>> ....
>>>> It looks like something is broken/old-code in sr. Most important LLDs
>>>> and block-layer scsi-ml fully support sg-chaining that effectively are
>>>> able to deliver limitless (Only limited by HW) sg sizes. It looks like
>>>> sr has some code that tries to allocate contiguous buffers larger than
>>>> PAGE_SIZE. Why does it do that? It should not be necessary any more.
>>>>
>>> The relevant driver is st 
>>
>> Sorry I meant st, yes.
>>
>>> and it use sg chaining when necessary. I tried 
>>> to explain that the effective limit in this case comes from mptsas. I 
>>> don't know if it is HW limit or driver limit.
>>>
>>
>> Than I don't understand where is the failing allocation. Where in the
>> code path anyone is trying to allocate something bigger then a page?
>> Please explain?
>>
> The function enlarge_buffer() in st.c tries to allocate a driver buffer 
> that is large enough for one block so that the number of contiguous memory 
> blocks does not exceed the allowed maximum. Allocation is done using 
> alloc_pages() (at line 3744 in st.c in 2.6.36), usually with order > 0.
> 

I looked at enlarge_buffer() and it looks fragile and broken. If you really
need a pointer eg:
	STbuffer->b_data = page_address(STbuffer->reserved_pages[0]);

Than way not use vmalloc() for buffers larger then PAGE_SIZE? But better yet
avoid it by keeping a pages_array or sg-list and operate on an aio type
operations.

> Kai

But I understand this is a lot of work on an old driver. Perhaps pre-allocate
something big at startup. specified by user?

Thanks
Boaz

  reply	other threads:[~2010-11-30 17:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28 19:15 After memory pressure: can't read from tape anymore Lukas Kolbe
2010-11-29 17:09 ` Kai Makisara
2010-11-30 13:31   ` Lukas Kolbe
2010-11-30 16:10     ` Boaz Harrosh
2010-11-30 16:23       ` Kai Makisara
2010-11-30 16:44         ` Boaz Harrosh
2010-11-30 17:04           ` Kai Makisara
2010-11-30 17:24             ` Boaz Harrosh [this message]
2010-11-30 19:53               ` Kai Makisara
2010-12-01  9:40                 ` Lukas Kolbe
2010-12-02 11:17                   ` Desai, Kashyap
2010-12-02 16:22                     ` Kai Makisara
2010-12-02 18:14                       ` Desai, Kashyap
2010-12-02 20:25                         ` Kai Makisara
2010-12-05 10:44                           ` Lukas Kolbe
2010-12-03 10:13                       ` FUJITA Tomonori
2010-12-03 10:45                         ` Desai, Kashyap
2010-12-03 11:11                           ` FUJITA Tomonori
2010-12-02 10:01                 ` Lukas Kolbe
2010-12-03  9:44               ` FUJITA Tomonori
2010-11-30 16:20     ` Kai Makisara
2010-12-01 17:06       ` Lukas Kolbe
2010-12-02 16:41         ` Kai Makisara
2010-12-06  7:59           ` Kai Makisara
2010-12-06  8:50             ` FUJITA Tomonori
2010-12-06  9:36             ` Lukas Kolbe
2010-12-06 11:34               ` Bjørn Mork
2010-12-08 14:19               ` Lukas Kolbe
2010-12-03 12:27   ` FUJITA Tomonori
2010-12-03 14:59     ` Kai Mäkisara
2010-12-03 15:06       ` James Bottomley
2010-12-03 17:03         ` Lukas Kolbe
2010-12-03 18:10           ` James Bottomley
2010-12-05 10:53             ` Lukas Kolbe
2010-12-05 12:16               ` FUJITA Tomonori
2010-12-14 20:35             ` Vladislav Bolkhovitin
2010-12-14 22:23               ` Stephen Hemminger
2010-12-15 16:27                 ` Vladislav Bolkhovitin

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=4CF53349.10509@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkolbe@techfak.uni-bielefeld.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox