[lkml]   [2017]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/2 v2] sched/wait: Introduce lock breaker in wake_up_page_bit
On Fri, Aug 25, 2017 at 5:31 PM, Linus Torvalds
<> wrote:
> It made it way more fragile and complicated, having to rewrite things
> so carefully. A simple slab cache would likely be a lot cleaner and
> simpler.

It also turns out that despite all the interfaces, we only really ever
wait on two different bits: PG_locked and PG_writeback. Nothing else.

Even the add_page_wait_queue() thing, which looks oh-so-generic,
really only waits on PG_locked.

And the PG_writeback case never really cares for the "locked" case, so
this incredibly generic interface that allows you to wait on any bit
you want, and has the whole exclusive wait support for getting
exclusive access to the bit really only has three cases:

- wait for locked exclusive (wake up first waiter when unlocked)

- wait for locked (wake up all waiters when unlocked)

- wait for writeback (wake up all waiters when no longer under writeback)

and those last two could probably even share the same queue.

But even without sharing the same queue, we could just do a per-page
allocation for the three queues - and probably that stupiud
add_page_wait_queue() waitqueue too. So no "per-page and per-bit"
thing, just a per-page thing.

I'll try writing that up.

Simplify, simplify, simplify.


 \ /
  Last update: 2017-08-26 04:54    [W:0.108 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site