lkml.org 
[lkml]   [2011]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm: remove worrying dead code from find_get_pages()
From
Date
On Wed, 2011-02-23 at 21:31 -0800, Hugh Dickins wrote:
> The radix_tree_deref_retry() case in find_get_pages() has a strange
> little excrescence, not seen in the other gang lookups: it looks like
> the start of an abandoned attempt to guarantee forward progress in a
> case that cannot arise.
>
> ret should always be 0 here: if it isn't, then going back to restart
> will leak references to pages already gotten. There used to be a
> comment saying nr_found is necessarily 1 here: that's not quite true,
> but the radix_tree_deref_retry() case is peculiar to the entry at index
> 0, when we race with it being moved out of the radix_tree root or back.
>
> Remove the worrisome two lines, add a brief comment here and in
> find_get_pages_contig() and find_get_pages_tag(), and a WARN_ON
> in find_get_pages() should it ever be seen elsewhere than at 0.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>




\
 
 \ /
  Last update: 2011-02-24 13:41    [W:0.023 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site