[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <faa56419-bdce-c539-5eee-5e180c62b0a5@ursulin.net>
Date: Thu, 8 Mar 2018 07:59:33 +0000
From: Tvrtko Ursulin <tursulin@...ulin.net>
To: James Bottomley <James.Bottomley@...senPartnership.com>,
linux-kernel@...r.kernel.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@...el.com>,
Bart Van Assche <bart.vanassche@....com>,
Hannes Reinecke <hare@...e.com>,
Johannes Thumshirn <jthumshirn@...e.de>,
Jens Axboe <axboe@...nel.dk>,
"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org
Subject: Re: [PATCH 6/6] lib/scatterlist: Drop order argument from
sgl_free_n_order
Hi,
On 07/03/18 18:30, James Bottomley wrote:
> On Wed, 2018-03-07 at 12:47 +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@...el.com>
>
> Firstly, I don't see any justifiable benefit to churning this API, so
> why bother? but secondly this:
Primarily because I wanted to extend sgl_alloc_order slightly in order
to be able to use it from i915. And then in the process noticed a couple
of bugs in the implementation, type inconsistencies and unused exported
symbols. That gave me a feeling API could actually use a bit of work.
>> We can derive the order from sg->length and so do not need to pass it
>> in explicitly.
>
> Is wrong. I can have a length 2 scatterlist that crosses a page
> boundary, but I can also have one within a single page, so the order
> cannot be deduced from the length.
sgl_alloc_order never does this.
However there is a different bug in my patch relating to the last entry
which can have shorter length from the rest. So get_order on the last
entry is incorrect - I have to store the deduced order and carry it over.
In which case it may even make sense to refactor sgl_alloc_order a bit
more to avoid wastage on the last entry with high order allocations.
Regards,
Tvrtko
Powered by blists - more mailing lists