[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190207214917.9d07ca3fc52d3df0cde018bd@linux-foundation.org>
Date: Thu, 7 Feb 2019 21:49:17 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: john.hubbard@...il.com
Cc: Nick Piggin <npiggin@...e.de>, linux-mm@...ck.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Dave Kleikamp <shaggy@...ux.vnet.ibm.com>,
Hugh Dickins <hughd@...gle.com>,
Jeff Layton <jlayton@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Vlastimil Babka <vbabka@...e.cz>,
LKML <linux-kernel@...r.kernel.org>,
John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH 1/1] mm: page_cache_add_speculative(): refactor out some
code duplication
On Wed, 6 Feb 2019 15:10:16 -0800 john.hubbard@...il.com wrote:
> From: John Hubbard <jhubbard@...dia.com>
>
> This combines the common elements of these routines:
>
> page_cache_get_speculative()
> page_cache_add_speculative()
>
> This was anticipated by the original author, as shown by the comment
> in commit ce0ad7f095258 ("powerpc/mm: Lockless get_user_pages_fast()
> for 64-bit (v3)"):
>
> "Same as above, but add instead of inc (could just be merged)"
>
> There is no intention to introduce any behavioral change, but there is a
> small risk of that, due to slightly differing ways of expressing the
> TINY_RCU and related configurations.
>
> This also removes the VM_BUG_ON(in_interrupt()) that was in
> page_cache_add_speculative(), but not in page_cache_get_speculative(). This
> provides slightly less detection of such bugs, but it given that it was
> only there on the "add" path anyway, we can likely do without it just fine.
It removes the
VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page);
also.
We'll live ;)
Powered by blists - more mailing lists