Message ID | 20200326122429.20710-2-willy@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Make PageWriteback use the PageLocked optimisation | expand |
Hi Matthew, Sorry I missed this, I'm over on @kernel.org now and don't have access to my old @arm.com address anymore. On Thu, Mar 26, 2020 at 05:24:28AM -0700, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" <willy@infradead.org> > > This local definition hasn't been used since commit 84c6591103db > ("locking/atomics, asm-generic/bitops/lock.h: Rewrite using > atomic_fetch_*()") which provided a default definition. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Cc: Will Deacon <will.deacon@arm.com> > --- > mm/filemap.c | 23 ----------------------- > 1 file changed, 23 deletions(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index 80f7e1ae744c..312afbfcb49a 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1248,29 +1248,6 @@ void add_page_wait_queue(struct page *page, wait_queue_entry_t *waiter) > } > EXPORT_SYMBOL_GPL(add_page_wait_queue); > > -#ifndef clear_bit_unlock_is_negative_byte > - > -/* > - * PG_waiters is the high bit in the same byte as PG_lock. > - * > - * On x86 (and on many other architectures), we can clear PG_lock and > - * test the sign bit at the same time. But if the architecture does > - * not support that special operation, we just do this all by hand > - * instead. > - * > - * The read of PG_waiters has to be after (or concurrently with) PG_locked > - * being cleared, but a memory barrier should be unneccssary since it is > - * in the same byte as PG_locked. > - */ > -static inline bool clear_bit_unlock_is_negative_byte(long nr, volatile void *mem) > -{ > - clear_bit_unlock(nr, mem); > - /* smp_mb__after_atomic(); */ > - return test_bit(PG_waiters, mem); > -} > - > -#endif > - I'd really like to do this, but I worry that the generic definition still isn't available on all architectures depending on how they pull together their bitops.h. Have you tried building for alpha or s390? At a quick glance, they look like they might fall apart :( Will
On Thu, Apr 16, 2020 at 01:45:39PM +0100, Will Deacon wrote: > Sorry I missed this, I'm over on @kernel.org now and don't have access to > my old @arm.com address anymore. Oops. Shame they haven't started bouncing it yet, so I didn't know. > > -static inline bool clear_bit_unlock_is_negative_byte(long nr, volatile void *mem) > > -{ > > - clear_bit_unlock(nr, mem); > > - /* smp_mb__after_atomic(); */ > > - return test_bit(PG_waiters, mem); > > -} > > I'd really like to do this, but I worry that the generic definition still > isn't available on all architectures depending on how they pull together > their bitops.h. Have you tried building for alpha or s390? At a quick > glance, they look like they might fall apart :( I haven't, but fortunately the 0day build bot has! It built both s390 and alpha successfully (as well as 120+ other configurations).
diff --git a/mm/filemap.c b/mm/filemap.c index 80f7e1ae744c..312afbfcb49a 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1248,29 +1248,6 @@ void add_page_wait_queue(struct page *page, wait_queue_entry_t *waiter) } EXPORT_SYMBOL_GPL(add_page_wait_queue); -#ifndef clear_bit_unlock_is_negative_byte - -/* - * PG_waiters is the high bit in the same byte as PG_lock. - * - * On x86 (and on many other architectures), we can clear PG_lock and - * test the sign bit at the same time. But if the architecture does - * not support that special operation, we just do this all by hand - * instead. - * - * The read of PG_waiters has to be after (or concurrently with) PG_locked - * being cleared, but a memory barrier should be unneccssary since it is - * in the same byte as PG_locked. - */ -static inline bool clear_bit_unlock_is_negative_byte(long nr, volatile void *mem) -{ - clear_bit_unlock(nr, mem); - /* smp_mb__after_atomic(); */ - return test_bit(PG_waiters, mem); -} - -#endif - /** * unlock_page - unlock a locked page * @page: the page