lkml.org 
[lkml]   [2010]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] block: fix leaks associated with discard request payload
On 06/27/2010 06:29 PM, James Bottomley wrote:
<snip>
>> + /*
>> + * If this is a discard request that originated from the kernel
>> + * we need to free our payload here. Note that we need to check
>> + * the request flag as the normal payload rules apply for
>> + * pass-through UNMAP / WRITE SAME requests.
>> + */
>> + __free_page(bio_page(cmd->request->bio));
>
> This is another layering violation: the page is allocated in the Upper
> layer and freed in the mid-layer.
>

May I ask a silly question? Why the dynamic allocation?

Why not have a const-static single global page at the block-layer somewhere
that will be used for all discard-type operations and be done with it once and
for all. A single page can be used for any size bio , any number of concurrent
discards, any ZERO needed operation. It can also be used by other operations
like padding and others. In fact isn't there one for the libsata padding?

(It could be dynamical allocated on first use for embedded system)

just my $0.017
Boaz


\
 
 \ /
  Last update: 2010-06-30 10:35    [W:0.107 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site