[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090107133535.858ce125.akpm@linux-foundation.org>
Date: Wed, 7 Jan 2009 13:35:35 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Andi Kleen <andi@...stfloor.org>
Cc: torvalds@...ux-foundation.org, peterz@...radead.org,
paulmck@...ux.vnet.ibm.com, ghaskins@...ell.com, mingo@...e.hu,
matthew@....cx, andi@...stfloor.org, chris.mason@...cle.com,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-btrfs@...r.kernel.org, tglx@...utronix.de,
rostedt@...dmis.org, npiggin@...e.de, pmorreale@...ell.com,
SDietrich@...ell.com
Subject: Re: [PATCH -v5][RFC]: mutex: implement adaptive spinning
On Wed, 7 Jan 2009 22:37:40 +0100
Andi Kleen <andi@...stfloor.org> wrote:
> > But we can do that with __get_user(thread_info->cpu) (very unlikely page
> > fault protection due to the possibility of CONFIG_DEBUG_PAGEALLOC) and
> > then validating the cpu. It it's in range, we can use it and verify
> > whether cpu_rq(cpu)->curr has that thread_info.
> >
> > So we can do all that locklessly and optimistically, just going back and
> > verifying the results later. This is why "thread_info" is actually a
> > better thing to use than "task_struct" - we can look up the cpu in it with
> > a simple dereference. We knew the pointer _used_ to be valid, so in any
> > normal situation, it will never page fault (and if you have
> > CONFIG_DEBUG_PAGEALLOC and hit a very unlucky race, then performance isn't
> > your concern anyway: we just need to make the page fault be non-lethal ;)
>
> The problem with probe_kernel_address() is that it does lots of
> operations around the access in the hot path (set_fs, pagefault_disable etc.),
> so i'm not sure that's a good idea.
probe_kernel_address() isn't tooooo bad - a few reads and writes into
the task_struct and thread_struct. And we're on the slow, contended
path here anyway..
--
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