Re: [Cluster-devel] [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-24 Thread Peter Zijlstra
On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote: > +void shrinker_unregister(struct shrinker *shrinker) > +{ > + struct dentry *debugfs_entry; > + int debugfs_id; > + > + if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED)) > + return; > + > +

Re: [Cluster-devel] [RFC 0/2] refcount: attempt to avoid imbalance warnings

2022-07-01 Thread Peter Zijlstra
On Thu, Jun 30, 2022 at 09:34:10AM -0700, Linus Torvalds wrote: Not commenting on sparse, since I'm not much qualified there, however, > include/linux/compiler_types.h | 2 ++ > include/linux/refcount.h | 6 +++--- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git

Re: [Cluster-devel] [RFC 1/2] refcount: add __cond_lock() for conditional lock refcount API

2022-06-30 Thread Peter Zijlstra
On Thu, Jun 30, 2022 at 09:59:33AM -0400, Alexander Aring wrote: > This patch adds the __cond_lock() macro to refcounts conditional lock > API. Currently sparse cannot detect the conditional lock handling of > refcount_dec_and_lock() functionality and prints a context imbalance > warning like: >

Re: [Cluster-devel] RFC: hold i_rwsem until aio completes

2020-01-15 Thread Peter Zijlstra
On Wed, Jan 15, 2020 at 09:24:28AM -0400, Jason Gunthorpe wrote: > I was interested because you are talking about allowing the read/write side > of a rw sem to be held across a return to user space/etc, which is the > same basic problem. No it is not; allowing the lock to be held across

Re: [Cluster-devel] [RFC][PATCH] wake_up_var() memory ordering

2019-06-25 Thread Peter Zijlstra
On Tue, Jun 25, 2019 at 02:12:22PM +0200, Andreas Gruenbacher wrote: > > Only if we do as David suggested and make clean_and_wake_up_bit() > > provide the RELEASE barrier. > > (It's clear_and_wake_up_bit, not clean_and_wake_up_bit.) Yes, typing hard. > > That is, currently

Re: [Cluster-devel] [RFC][PATCH] wake_up_var() memory ordering

2019-06-25 Thread Peter Zijlstra
(sorry for cross-posting to moderated lists btw, I've since acquired a patch to get_maintainers.pl that wil exclude them in the future) On Tue, Jun 25, 2019 at 08:51:01AM +0100, David Howells wrote: > Peter Zijlstra wrote: > > > I tried using wake_up_var() today and accident

[Cluster-devel] [RFC][PATCH] wake_up_var() memory ordering

2019-06-25 Thread Peter Zijlstra
Hi all, I tried using wake_up_var() today and accidentally noticed that it didn't imply an smp_mb() and specifically requires it through wake_up_bit() / waitqueue_active(). Now, wake_up_bit() doesn't imply the barrier because it is assumed to be used with the atomic bitops API which either