lkml.org 
[lkml]   [2013]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
From
On Sun, Sep 1, 2013 at 4:30 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Hrm... It excludes sharing between the locks, all right. AFAICS, that
> won't exclude sharing with plain per-cpu vars, will it?

Yes it will. DEFINE_PER_CPU_SHARED_ALIGNED not only aligns the data,
it also puts it in a separate section with only other aligned data
entries. So now the percpu address map around it looks like this:

...
0000000000013a80 d call_single_queue
0000000000013ac0 d cfd_data
0000000000013b00 d files_lglock_lock
0000000000013b40 d vfsmount_lock_lock
0000000000013b80 d file_lock_lglock_lock
0000000000013bc0 D softnet_data
0000000000013d40 D __per_cpu_end
..

So there shouldn't be anything to share falsely with.

I'd like to say that the profile is bad, but this is *so* consistent,
and the profile data really looks perfectly fine in every other way.
I'm using "-e cycles:pp", so it's using hardware profiling and all the
other functions really look correct.

It *is* one of the few locked accesses remaining, and it's clearly
getting called a lot (three calls per system call: two mntput's - one
for the root path, one for the result path, and one from path_init ->
rcu_walk_init), but with up to 8% CPU time for basically that one
"lock xadd" instruction is damn odd. I can't see how that could happen
without seriously nasty cacheline bouncing, but I can't see how *that*
can happen when all the accesses seem to be from the current CPU.

This is a new Haswell-based machine that I put together yesterdat, and
I haven't used it for profiling before. So maybe it _is_ something odd
with the profiling after all, and atomic serializing instructions get
incorrect profile counts.

Linus


\
 
 \ /
  Last update: 2013-09-02 02:41    [W:0.265 / U:3.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site