All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
	Waiman Long <waiman.long@hp.com>, Ingo Molnar <mingo@kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Jeff Layton <jlayton@redhat.com>,
	Miklos Szeredi <mszeredi@suse.cz>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andi Kleen <andi@firstfloor.org>,
	"Chandramouleeswaran, Aswin" <aswin@hp.com>,
	"Norton, Scott J" <scott.norton@hp.com>
Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
Date: Sun, 1 Sep 2013 15:48:01 -0700	[thread overview]
Message-ID: <CA+55aFzsXwFkYsWY45ZNTaVFC+-1Yh9nxx=NLhv+NxGmQAKHTg@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFzkZi6Q1bwSZUJxyfqUgLS05icjrObdCxC+4S-3Tup9Ew@mail.gmail.com>

On Sun, Sep 1, 2013 at 3:16 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I wonder if there is some false sharing going on. But I don't see that
> either, this is the percpu offset map afaik:
>
>   000000000000f560 d files_lglock_lock
>   000000000000f564 d nr_dentry
>   000000000000f568 d last_ino
>   000000000000f56c d nr_unused
>   000000000000f570 d nr_inodes
>   000000000000f574 d vfsmount_lock_lock
>   000000000000f580 d bh_accounting

I made DEFINE_LGLOCK use DEFINE_PER_CPU_SHARED_ALIGNED for the
spinlock, so that each local lock gets its own cacheline, and the
total loops jumped to 62M (from 52-54M before). So when I looked at
the numbers, I thought "oh, that helped".

But then I looked closer, and realized that I just see a fair amount
of boot-to-boot variation anyway (probably a lot to do with cache
placement and how dentries got allocated etc). And it didn't actually
help at all, the problem is stilte there, and lg_local_lock is still
really really high on the profile, at 8% cpu time:

-   8.00%  lg_local_lock
   - lg_local_lock
      + 64.83% mntput_no_expire
      + 33.81% path_init
      + 0.78% mntput
      + 0.58% path_lookupat

which just looks insane. And no, no lg_global_lock visible anywhere..

So it's not false sharing. But something is bouncing *that* particular
lock around.

              Linus

---
  34.60%      lockref_get_or_lock
  23.35%      lockref_put_or_lock
  10.57%      dput
   8.00%      lg_local_lock
   1.79%      copy_user_enhanced_fast_string
   1.15%      link_path_walk
   1.04%      path_lookupat
   1.03%      sysret_check
   1.01%      kmem_cache_alloc
   1.00%      selinux_inode_permission
   0.97%      __d_lookup_rcu
   0.95%      kmem_cache_free
   0.90%      0x00007f03e0800ee3
   0.88%      avc_has_perm_noaudit
   0.79%      cp_new_stat
   0.76%      avc_has_perm_flags
   0.69%      path_init
   0.68%      getname_flags
   0.66%      system_call
   0.58%      generic_permission
   0.55%      lookup_fast
   0.54%      user_path_at_empty
   0.51%      vfs_fstatat
   0.49%      vfs_getattr
   0.49%      filename_lookup
   0.49%      strncpy_from_user
   0.44%      generic_fillattr
   0.40%      inode_has_perm.isra.32.constprop.61
   0.38%      ext4_getattr
   0.34%      complete_walk
   0.34%      lg_local_unlock
   0.27%      d_rcu_to_refcount
   0.25%      __inode_permission
   0.23%      _copy_to_user
   0.23%      security_inode_getattr
   0.22%      mntget
   0.22%      selinux_inode_getattr
   0.21%      SYSC_newstat
   0.21%      mntput_no_expire
   0.20%      putname
   0.17%      path_put
   0.16%      security_inode_permission
   0.16%      start_routine
   0.14%      mntput
   0.14%      final_putname
   0.14%      _cond_resched
   0.12%      inode_permission
   0.10%      user_path_at
   0.09%      __xstat64
   0.07%      sys_newstat
   0.03%      __xstat@plt
   0.03%      update_cfs_rq_blocked_load
   0.02%      task_tick_fair
   0.01%      common_interrupt
   0.01%      ktime_get
   0.01%      lapic_next_deadline
   0.01%      run_timer_softirq
   0.01%      hsw_unclaimed_reg_check.isra.6
   0.01%      sched_clock_cpu
   0.01%      rcu_check_callbacks
   0.01%      update_cfs_shares
   0.01%      _raw_spin_lock
   0.01%      irqtime_account_irq
   0.01%      __do_softirq
   0.01%      ret_from_sys_call
   0.01%      i915_read32
   0.01%      hrtimer_interrupt
   0.01%      update_curr
   0.01%      profile_tick
   0.00%      intel_pmu_disable_all
   0.00%      intel_pmu_enable_all
   0.00%      tg_load_down
   0.00%      native_sched_clock
   0.00%      native_apic_msr_eoi_write
   0.00%      irqtime_account_process_tick.isra.2
   0.00%      perf_event_task_tick
   0.00%      clockevents_program_event
   0.00%      __acct_update_integrals
   0.00%      rcu_irq_exit

  parent reply	other threads:[~2013-09-01 22:48 UTC|newest]

Thread overview: 154+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
2013-08-06  3:12 ` [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Waiman Long
2013-08-29  1:40   ` Linus Torvalds
2013-08-29  4:44     ` Benjamin Herrenschmidt
2013-08-29  7:00       ` Ingo Molnar
2013-08-29 16:43         ` Linus Torvalds
2013-08-29 19:25           ` Linus Torvalds
2013-08-29 23:42             ` Linus Torvalds
2013-08-30  0:26               ` Benjamin Herrenschmidt
2013-08-30  0:49                 ` Linus Torvalds
2013-08-30  2:06                   ` Michael Neuling
2013-08-30  2:30                     ` Benjamin Herrenschmidt
2013-08-30  2:35                       ` Linus Torvalds
2013-08-30  2:45                         ` Benjamin Herrenschmidt
2013-08-30  2:31                     ` Linus Torvalds
2013-08-30  2:43                       ` Benjamin Herrenschmidt
2013-08-30  7:16                   ` Ingo Molnar
2013-08-30 15:28                     ` Linus Torvalds
2013-08-30  3:12               ` Waiman Long
2013-08-30  3:54                 ` Linus Torvalds
2013-08-30  7:55                   ` Sedat Dilek
2013-08-30  8:10                     ` Sedat Dilek
2013-08-30  9:27                     ` Sedat Dilek
2013-08-30  9:48                       ` Ingo Molnar
2013-08-30  9:56                         ` Sedat Dilek
2013-08-30  9:58                           ` Sedat Dilek
2013-08-30 10:29                             ` Sedat Dilek
2013-08-30 10:36                               ` Peter Zijlstra
2013-08-30 10:44                                 ` Sedat Dilek
2013-08-30 10:46                                   ` Sedat Dilek
2013-08-30 10:52                                   ` Peter Zijlstra
2013-08-30 10:57                                     ` Sedat Dilek
2013-08-30 14:05                                       ` Sedat Dilek
2013-08-30 11:19                                 ` Sedat Dilek
2013-08-30 10:38                               ` Sedat Dilek
2013-08-30 15:34                       ` Linus Torvalds
2013-08-30 15:38                         ` Sedat Dilek
2013-08-30 16:12                           ` Steven Rostedt
2013-08-30 16:16                             ` Sedat Dilek
2013-08-30 18:42                             ` Linus Torvalds
2013-08-30 16:32                           ` Linus Torvalds
2013-08-30 16:37                             ` Sedat Dilek
2013-08-30 16:52                               ` Linus Torvalds
2013-08-30 17:11                                 ` Sedat Dilek
2013-08-30 17:26                                   ` Linus Torvalds
2013-09-01 10:01                                 ` Sedat Dilek
2013-09-01 10:33                                   ` Sedat Dilek
2013-09-01 15:32                                   ` Linus Torvalds
2013-09-01 15:45                                     ` Sedat Dilek
2013-09-01 15:55                                       ` Linus Torvalds
2013-09-02 10:30                                         ` Sedat Dilek
2013-09-02 16:09                                           ` David Ahern
2013-09-02 16:09                                             ` David Ahern
2013-09-01 20:59                                     ` Linus Torvalds
2013-09-01 21:23                                       ` Al Viro
2013-09-01 22:16                                         ` Linus Torvalds
2013-09-01 22:35                                           ` Al Viro
2013-09-01 22:44                                             ` Al Viro
2013-09-01 22:58                                               ` Linus Torvalds
2013-09-01 22:48                                           ` Linus Torvalds [this message]
2013-09-01 23:30                                             ` Al Viro
2013-09-02  0:12                                               ` Linus Torvalds
2013-09-02  0:50                                                 ` Linus Torvalds
2013-09-02  0:50                                                   ` Linus Torvalds
2013-09-02  7:05                                                   ` Ingo Molnar
2013-09-02 16:44                                                     ` Linus Torvalds
2013-09-03 10:15                                                       ` Ingo Molnar
2013-09-03 15:41                                                         ` Linus Torvalds
2013-09-03 18:34                                                           ` Linus Torvalds
2013-09-03 19:19                                                             ` Ingo Molnar
2013-09-03 21:05                                                               ` Linus Torvalds
2013-09-03 21:13                                                                 ` Linus Torvalds
2013-09-03 21:34                                                                   ` Linus Torvalds
2013-09-03 21:39                                                                     ` Linus Torvalds
2013-09-03 14:08                                                       ` Pavel Machek
2013-09-03 22:37                                     ` Sedat Dilek
2013-09-03 22:55                                       ` Dave Jones
2013-09-03 23:05                                         ` Sedat Dilek
2013-09-03 23:15                                           ` Dave Jones
2013-09-03 23:20                                             ` Sedat Dilek
2013-09-03 23:45                                       ` Sedat Dilek
2013-08-30 18:33                   ` Waiman Long
2013-08-30 18:53                     ` Linus Torvalds
2013-08-30 19:20                       ` Waiman Long
2013-08-30 19:33                         ` Linus Torvalds
2013-08-30 20:15                           ` Waiman Long
2013-08-30 20:43                             ` Linus Torvalds
2013-08-30 20:54                               ` Al Viro
2013-08-30 21:03                                 ` Linus Torvalds
2013-08-30 21:44                                   ` Al Viro
2013-08-30 22:30                                     ` Linus Torvalds
2013-08-31 21:23                                       ` Al Viro
2013-08-31 22:49                                         ` Linus Torvalds
2013-08-31 23:27                                           ` Al Viro
2013-09-01  0:13                                             ` Al Viro
2013-09-01 17:48                                               ` Al Viro
2013-09-09  8:30                                               ` Peter Zijlstra
2013-08-30 21:10                                 ` Waiman Long
2013-08-30 21:22                                   ` Linus Torvalds
2013-08-30 21:30                                   ` Al Viro
2013-08-30 21:42                                     ` Waiman Long
2013-08-30 19:40                         ` Al Viro
2013-08-30 19:52                           ` Waiman Long
2013-08-30 20:26                             ` Al Viro
2013-08-30 20:35                               ` Waiman Long
2013-08-30 20:48                                 ` Al Viro
2013-08-31  2:02                                   ` Waiman Long
2013-08-31  2:35                                     ` Al Viro
2013-08-31  2:42                                       ` Al Viro
2013-09-02 19:25                                         ` Waiman Long
2013-09-03  6:01                                           ` Ingo Molnar
2013-09-03  7:24                                             ` Sedat Dilek
2013-09-03 15:38                                               ` Linus Torvalds
2013-09-03 15:14                                             ` Waiman Long
2013-09-03 15:34                                               ` Linus Torvalds
2013-09-03 19:09                                                 ` Linus Torvalds
2013-09-03 21:01                                                   ` Waiman Long
2013-09-04 14:52                                                   ` Waiman Long
2013-09-04 15:14                                                     ` Linus Torvalds
2013-09-04 19:25                                                       ` Waiman Long
2013-09-04 21:34                                                         ` Linus Torvalds
2013-09-05  2:35                                                           ` Waiman Long
2013-09-05 13:31                                                     ` Ingo Molnar
2013-09-05 17:33                                                       ` Waiman Long
2013-09-05 17:40                                                         ` Ingo Molnar
2013-09-03 22:41                                               ` Sedat Dilek
2013-09-03 23:11                                                 ` Sedat Dilek
2013-09-03 23:11                                                   ` Sedat Dilek
2013-09-08 21:45               ` Linus Torvalds
2013-09-09  0:03                 ` Al Viro
2013-09-09  0:25                   ` Linus Torvalds
2013-09-09  0:35                     ` Al Viro
2013-09-09  0:38                       ` Linus Torvalds
2013-09-09  0:57                         ` Al Viro
2013-09-09  2:09                     ` Ramkumar Ramachandra
2013-09-09  0:30                   ` Al Viro
2013-09-09  3:32                   ` Linus Torvalds
2013-09-09  4:06                     ` Ramkumar Ramachandra
2013-09-09  5:44                     ` Al Viro
2013-08-30 17:17           ` Peter Zijlstra
2013-08-30 17:28             ` Linus Torvalds
2013-08-30 17:33               ` Linus Torvalds
2013-08-29 15:20     ` Waiman Long
2013-08-06  3:12 ` [PATCH v7 2/4] spinlock: Enable x86 architecture to do lockless refcount update Waiman Long
2013-08-06  3:12 ` [PATCH v7 3/4] dcache: replace d_lock/d_count by d_lockcnt Waiman Long
2013-08-06  3:12 ` [PATCH v7 4/4] dcache: Enable lockless update of dentry's refcount Waiman Long
2013-08-13 18:03 ` [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
2013-08-31  3:06 [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount George Spelvin
2013-08-31 17:16 ` Linus Torvalds
2013-09-01  8:50   ` George Spelvin
2013-09-01 11:10     ` Theodore Ts'o
2013-09-01 15:49       ` Linus Torvalds
2013-09-01 18:11         ` Steven Rostedt
2013-09-01 20:03           ` Linus Torvalds

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='CA+55aFzsXwFkYsWY45ZNTaVFC+-1Yh9nxx=NLhv+NxGmQAKHTg@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=aswin@hp.com \
    --cc=benh@kernel.crashing.org \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mszeredi@suse.cz \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=scott.norton@hp.com \
    --cc=sedat.dilek@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=waiman.long@hp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.