From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <ak@linux.intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>, Kan Liang <kan.liang@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>, Jan Kara <jack@suse.cz>,
linux-mm <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] sched/wait: Break up long wake list walk
Date: Wed, 16 Aug 2017 18:22:57 -0500 [thread overview]
Message-ID: <87inhnrtbi.fsf@xmission.com> (raw)
In-Reply-To: <CA+55aFxbo-4M8=3BZ_VbqvRTq6_Lbw6eUQz2tTh7ve5YhLdecw@mail.gmail.com> (Linus Torvalds's message of "Tue, 15 Aug 2017 16:50:34 -0700")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Tue, Aug 15, 2017 at 3:57 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> Oh, and the page wait-queue really needs that key argument too, which
>> is another thing that swait queue code got rid of in the name of
>> simplicity.
>
> Actually, it gets worse.
>
> Because the page wait queues are hashed, it's not an all-or-nothing
> thing even for the non-exclusive cases, and it's not a "wake up first
> entry" for the exclusive case. Both have to be conditional on the wait
> entry actually matching the page and bit in question.
>
> So no way to use swait, or any of the lockless queuing code in general
> (so we can't do some clever private wait-list using llist.h either).
>
> End result: it looks like you fairly fundamentally do need to use a
> lock over the whole list traversal (like the standard wait-queues),
> and then add a cursor entry like Tim's patch if dropping the lock in
> the middle.
>
> Anyway, looking at the old code, we *used* to limit the page wait hash
> table to 4k entries, and we used to have one hash table per memory
> zone.
>
> The per-zone thing didn't work at all for the generic bit-waitqueues,
> because of how people used them on virtual addresses on the stack.
>
> But it *could* work for the page waitqueues, which are now a totally
> separate entity, and is obviously always physically addressed (since
> the indexing is by "struct page" pointer), and doesn't have that
> issue.
>
> So I guess we could re-introduce the notion of per-zone page waitqueue
> hash tables. It was disgusting to allocate and free though (and hooked
> into the memory hotplug code).
>
> So I'd still hope that we can instead just have one larger hash table,
> and that is sufficient for the problem.
If increasing the hash table size fixes the problem I am wondering if
rhash tables might be the proper solution to this problem. They start
out small and then grow as needed.
Eric
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-08-16 23:23 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 0:52 Tim Chen
2017-08-15 0:52 ` [PATCH 2/2] sched/wait: Introduce lock breaker in wake_up_page_bit Tim Chen
2017-08-15 1:48 ` [PATCH 1/2] sched/wait: Break up long wake list walk Linus Torvalds
2017-08-15 2:27 ` Andi Kleen
2017-08-15 2:52 ` Linus Torvalds
2017-08-15 3:15 ` Andi Kleen
2017-08-15 3:28 ` Linus Torvalds
2017-08-15 19:05 ` Tim Chen
2017-08-15 19:41 ` Linus Torvalds
2017-08-15 19:47 ` Linus Torvalds
2017-08-15 22:47 ` Davidlohr Bueso
2017-08-15 22:56 ` Linus Torvalds
2017-08-15 22:57 ` Linus Torvalds
2017-08-15 23:50 ` Linus Torvalds
2017-08-16 23:22 ` Eric W. Biederman [this message]
2017-08-17 16:17 ` Liang, Kan
2017-08-17 16:25 ` Linus Torvalds
2017-08-17 20:18 ` Liang, Kan
2017-08-17 20:44 ` Linus Torvalds
2017-08-18 12:23 ` Mel Gorman
2017-08-18 14:20 ` Liang, Kan
2017-08-18 14:46 ` Mel Gorman
2017-08-18 16:36 ` Tim Chen
2017-08-18 16:45 ` Andi Kleen
2017-08-18 16:53 ` Liang, Kan
2017-08-18 17:48 ` Linus Torvalds
2017-08-18 18:54 ` Mel Gorman
2017-08-18 19:14 ` Linus Torvalds
2017-08-18 19:58 ` Andi Kleen
2017-08-18 20:10 ` Linus Torvalds
2017-08-21 18:32 ` Mel Gorman
2017-08-21 18:56 ` Liang, Kan
2017-08-22 17:23 ` Liang, Kan
2017-08-22 18:19 ` Linus Torvalds
2017-08-22 18:25 ` Linus Torvalds
2017-08-22 18:56 ` Peter Zijlstra
2017-08-22 19:15 ` Linus Torvalds
2017-08-22 19:08 ` Peter Zijlstra
2017-08-22 19:30 ` Linus Torvalds
2017-08-22 19:37 ` Andi Kleen
2017-08-22 21:08 ` Christopher Lameter
2017-08-22 21:24 ` Andi Kleen
2017-08-22 22:52 ` Linus Torvalds
2017-08-22 23:19 ` Linus Torvalds
2017-08-23 14:51 ` Liang, Kan
2017-08-22 19:55 ` Liang, Kan
2017-08-22 20:42 ` Linus Torvalds
2017-08-22 20:53 ` Peter Zijlstra
2017-08-22 20:58 ` Linus Torvalds
2017-08-23 14:49 ` Liang, Kan
2017-08-23 15:58 ` Tim Chen
2017-08-23 18:17 ` Linus Torvalds
2017-08-23 20:55 ` Liang, Kan
2017-08-23 23:30 ` Linus Torvalds
2017-08-24 17:49 ` Tim Chen
2017-08-24 18:16 ` Linus Torvalds
2017-08-24 20:44 ` Mel Gorman
2017-08-25 16:44 ` Tim Chen
2017-08-23 16:04 ` Mel Gorman
2017-08-18 20:05 ` Andi Kleen
2017-08-18 20:29 ` Linus Torvalds
2017-08-18 20:29 ` Liang, Kan
2017-08-18 20:34 ` Linus Torvalds
2017-08-18 16:55 ` Linus Torvalds
2017-08-18 13:06 ` Liang, Kan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87inhnrtbi.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tim.c.chen@linux.intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox