lkml.org 
[lkml]   [2003]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] swap 13/13 may_enter_fs?
On Tue, 25 Mar 2003, Andrew Morton wrote:

> Hugh Dickins <hugh@veritas.com> wrote:
> >
> > shrink_list's may_enter_fs (may_write_page would be a better name)
> > currently reflects that swapcache page I/O won't suffer from FS
> > complications, so can be done if __GFP_IO without __GFP_FS; but
> > the same is true of a tmpfs page (which is just this stage away
> > from being a swapcache page), so check bdi->memory_backed instead.
> >
> > ...
> >
> > + if (!(gfp_mask & (bdi->memory_backed?
> > + __GFP_IO: __GFP_FS)))
> > goto keep_locked;
>
> Barf. I haven't used a question mark operator in ten years, and this is a
> fine demonstration of why ;)
>
> I think a feasibly comprehensible transformation would be:
>
> /*
> * A comment goes here
> */
> if (bdi->memory_backed)
> may_enter_fs = gfp_mask & __GFP_IO;
> else
> may_enter_fs = gfp_mask & __GFP_FS;

Unless there's a subtle difference in functionality here that I'm missing,
you are doing the same thing in a larger and slower way, and the logic is
less clear.

Is there some benefit I'm missing?

--
bill davidsen <davidsen@tmr.com>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.093 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site