From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Hugh Dickins <hugh@veritas.com>,
linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH 01/15] mm: poison struct page for ptlock
Date: Thu, 10 Nov 2005 13:06:24 +0100 [thread overview]
Message-ID: <20051110120624.GB32672@elte.hu> (raw)
In-Reply-To: <20051109185645.39329151.akpm@osdl.org>
* Andrew Morton <akpm@osdl.org> wrote:
> > > But I think either a big patch or 2.95.x abandonment is preferable to this
> > > approach.
> >
> > Hmm, that's a pity.
>
> Well plan B is to kill spinlock_t.break_lock. That fixes everything
> and has obvious beneficial side-effects.
i'd really, really love to have this solved without restricting the type
flexibility of spinlocks.
do we really need 2.95.x support? gcc now produces smaller code with -S.
> a) x86 spinlock_t is but one byte. Can we stuff break_lock into the
> same word?
>
> (Yes, there's also a >128 CPUs spinlock overflow problem to solve,
> but perhaps we can use lock;addw?)
the >128 CPUs spinlock overflow problem is solved by going to 32-bit ops
(patch has been posted to lkml recently). 16-bit ops are out of
question. While byte ops are frequently optimized for (avoiding partial
register access related stalls), the same is not true for 16-bit
prefixed instructions! Mixing 32-bit with 16-bit code is going to suck
on a good number of x86 CPUs. It also bloats the instruction size of
spinlocks, due to the 16-bit prefix. (while byte access has its own
opcode)
also, there are arches where the only atomic op available is a 32-bit
one. So trying to squeeze the break_lock flag into the spinlock field is
i think unrobust.
> b) Redesign the code somehow. Currently break_lock means "there's
> someone waiting for this lock".
>
> But if we were to leave the lock in a decremented state while
> spinning (as we've always done), that info is still present via the
> value of spinlock_t.slock. Hence: bye-bye break_lock.
this wont work on arches that dont have atomic-decrement based
spinlocks. (some arches dont even have such an instruction) This means
those arches would have to implement a "I'm spinning" flag in the word,
which might or might not work (if the arch doesnt have an atomic
instruction that works on the owner bit only then it becomes impossible)
- but in any case it would need very fragile per-arch assembly work to
pull off.
> c) Make the break_lock stuff a new config option,
> CONFIG_SUPER_LOW_LATENCY_BLOATS_STRUCT_PAGE.
>
> d) Revert it wholesale, have sucky SMP worst-case latency ;)
yuck. What is the real problem btw? AFAICS there's enough space for a
2-word spinlock in struct page for pagetables. We really dont want to
rewrite spinlocks (or remove features) just to keep gcc 2.95 supported
for some more time. In fact, is there any 2.6 based distro that uses gcc
2.95?
Ingo
next prev parent reply other threads:[~2005-11-10 12:06 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-10 1:42 [PATCH 00/15] mm: struct page lock and counts Hugh Dickins
2005-11-10 1:43 ` [PATCH 01/15] mm: poison struct page for ptlock Hugh Dickins
2005-11-10 2:10 ` Andrew Morton
2005-11-10 2:22 ` Hugh Dickins
2005-11-10 2:56 ` Andrew Morton
2005-11-10 2:58 ` Andrew Morton
2005-11-10 11:28 ` Ingo Molnar
2005-11-10 12:06 ` Ingo Molnar [this message]
2005-11-10 12:26 ` Andrew Morton
2005-11-10 21:37 ` Christoph Lameter
2005-11-10 21:52 ` Christoph Hellwig
2005-11-11 10:46 ` Ingo Molnar
2005-11-12 23:48 ` Adrian Bunk
2005-11-10 12:35 ` Hugh Dickins
2005-11-10 12:51 ` Andrew Morton
2005-11-10 13:29 ` Hugh Dickins
2005-11-10 15:00 ` Ingo Molnar
2005-11-10 15:38 ` Hugh Dickins
2005-11-10 19:49 ` Andrew Morton
2005-11-10 19:56 ` Linus Torvalds
2005-11-11 0:10 ` Russell King
2005-11-12 6:27 ` Benjamin Herrenschmidt
2005-11-11 15:02 ` Hugh Dickins
2005-11-15 18:49 ` Andrew Morton
2005-11-15 19:51 ` Hugh Dickins
2005-11-15 20:05 ` Andrew Morton
2005-11-10 1:44 ` [PATCH 02/15] mm: revert page_private Hugh Dickins
2005-11-10 1:46 ` [PATCH 03/15] mm reiser4: " Hugh Dickins
2005-11-10 1:47 ` [PATCH 04/15] mm: update split ptlock Kconfig Hugh Dickins
2005-11-10 1:48 ` [PATCH 05/15] mm: unbloat get_futex_key Hugh Dickins
2005-11-10 1:50 ` [PATCH 06/15] mm: remove ppc highpte Hugh Dickins
2005-11-10 1:52 ` Benjamin Herrenschmidt
2005-11-10 1:55 ` Paul Mackerras
2005-11-10 2:46 ` Hugh Dickins
2005-11-10 1:51 ` [PATCH 07/15] mm: powerpc ptlock comments Hugh Dickins
2005-11-10 1:53 ` [PATCH 08/15] mm: powerpc init_mm without ptlock Hugh Dickins
2005-11-10 1:56 ` [PATCH 09/15] mm: fill arch atomic64 gaps Hugh Dickins
2005-11-10 13:38 ` Andi Kleen
2005-11-10 15:19 ` Hugh Dickins
2005-11-10 1:57 ` [PATCH 10/15] mm: atomic64 page counts Hugh Dickins
2005-11-10 2:16 ` Andrew Morton
2005-11-10 2:33 ` Hugh Dickins
2005-11-10 3:01 ` Andrew Morton
2005-11-10 21:43 ` Christoph Lameter
2005-11-10 21:53 ` Andrew Morton
2005-11-11 15:25 ` Hugh Dickins
2005-11-11 18:03 ` Christoph Lameter
2005-11-10 2:00 ` [PATCH 11/15] mm: long " Hugh Dickins
2005-11-10 2:01 ` [PATCH 12/15] mm reiser4: " Hugh Dickins
2005-11-10 2:03 ` [PATCH 13/15] mm: get_user_pages check count Hugh Dickins
2005-11-10 2:08 ` [PATCH 14/15] mm: inc_page_table_pages check max Hugh Dickins
2005-11-10 2:09 ` [PATCH 15/15] mm: remove install_page limit Hugh Dickins
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=20051110120624.GB32672@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®