[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyVNDFY87V2TZ9ViS7TUMyH7n88g-V=CdB5_c9+=M+fNQ@mail.gmail.com>
Date: Wed, 18 Dec 2013 13:37:27 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Dave Jones <davej@...hat.com>,
Darren Hart <dvhart@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Mel Gorman <mgorman@...e.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -mm 6/7] mm: thp: introduce get_lock_thp_head()
On Wed, Dec 18, 2013 at 11:20 AM, Oleg Nesterov <oleg@...hat.com> wrote:
> Both __put_page_tail() and __get_page_tail() need to carefully
> take a reference on page_head, take compound_lock() and recheck
> PageTail(page) under this lock.
Btw I suspect this is just disgustingly expensive, and I don't think
there's a really good reason for it.
May I suggest:
- getting rid of the PG_compound_lock bit-lock
bitlocks are expensive and unfair, and don't even get lockdep checking
- replace it with a (small, say 32-256 entries) array of hashed sequence locks
- just hash based on the "struct page" pointer, and teach this code
to do a read_seqcount_begin/read_seqcount_retry sequence instead for
the page lookup.
I think you can get rid of all the irq disables too, and the sequence
lock should be pure memory reads for the read-case that we care about.
Hmm? This is obviously orthogonal to your series, I just reacted to
seeing that bitlock thing that needs atomics for both locking and
unlocking and the irq disable, and just generally looks like the worst
possible way to do these things.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists