Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-10-14 Thread Peter Zijlstra
On Mon, Oct 14, 2019 at 11:25:09AM +0200, Greg KH wrote: > Good luck, I don't really think that most, if any, of this is needed, > but hey, it's nice to clean it up where it can be :) Some of the virtual devices we have (that use devm) really ought to set the node too, like drivers/base/cpu.c and

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-10-10 Thread Peter Zijlstra
On Wed, Oct 09, 2019 at 01:25:14PM +0100, Robin Murphy wrote: > On 2019-10-08 9:38 am, Yunsheng Lin wrote: > > On 2019/9/25 18:41, Peter Zijlstra wrote: > > > On Wed, Sep 25, 2019 at 05:14:20PM +0800, Yunsheng Lin wrote: > > > > From the discussion above, It seems

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-26 Thread Peter Zijlstra
On Thu, Sep 26, 2019 at 11:05:59AM +0200, Peter Zijlstra wrote: > On Wed, Sep 25, 2019 at 11:45:26PM +0200, Peter Zijlstra wrote: > > [7.149889] [Firmware Bug]: device: 'pci:7f': no node assigned on > > NUMA capable HW > > [7.882888] [Firmware Bug]: device:

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-26 Thread Peter Zijlstra
On Wed, Sep 25, 2019 at 11:45:26PM +0200, Peter Zijlstra wrote: > [7.149889] [Firmware Bug]: device: 'pci:7f': no node assigned on NUMA > capable HW > [7.882888] [Firmware Bug]: device: 'pci:ff': no node assigned on NUMA > capable HW Going by the limited number o

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-25 Thread Peter Zijlstra
On Wed, Sep 25, 2019 at 06:31:54PM +0200, Peter Zijlstra wrote: > On Wed, Sep 25, 2019 at 03:25:44PM +0200, Michal Hocko wrote: > > I am sorry but I still do not understand why you consider this whack a > > mole better then simply live with the fact that NUMA_NO_NODE i

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-25 Thread Peter Zijlstra
On Wed, Sep 25, 2019 at 05:14:20PM +0800, Yunsheng Lin wrote: > From the discussion above, It seems making the node_to_cpumask_map() > NUMA_NO_NODE aware is the most feasible way to move forwad. That's still wrong.

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-25 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 03:19:39PM +0200, Michal Hocko wrote: > > The below would get rid of the PMU and workqueue warnings with no > > side-effects (the device isn't used for anything except sysfs). > > Hardcoding to 0 is simply wrong, if the node0 is cpuless for example... It doesn't

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-24 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 02:43:25PM +0200, Peter Zijlstra wrote: > On Tue, Sep 24, 2019 at 02:25:00PM +0200, Michal Hocko wrote: > > On Tue 24-09-19 14:09:43, Peter Zijlstra wrote: > > > > We can push back and say we don't respect the specification because it &g

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-24 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 02:25:00PM +0200, Michal Hocko wrote: > On Tue 24-09-19 14:09:43, Peter Zijlstra wrote: > > We can push back and say we don't respect the specification because it > > is batshit insane ;-) > > Here is my fingers crossed. > > [...] > >

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-24 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 07:07:36PM +0800, Yunsheng Lin wrote: > On 2019/9/24 17:25, Peter Zijlstra wrote: > > On Tue, Sep 24, 2019 at 09:29:50AM +0800, Yunsheng Lin wrote: > >> On 2019/9/24 4:34, Peter Zijlstra wrote: > > > >>> I'm saying the ACPI

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-24 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 12:56:22PM +0200, Michal Hocko wrote: > On Tue 24-09-19 11:17:14, Peter Zijlstra wrote: > > On Tue, Sep 24, 2019 at 09:47:51AM +0200, Michal Hocko wrote: > > > On Mon 23-09-19 22:34:10, Peter Zijlstra wrote: > > > > On Mon, Sep 23, 2019 at

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-24 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 09:29:50AM +0800, Yunsheng Lin wrote: > On 2019/9/24 4:34, Peter Zijlstra wrote: > > I'm saying the ACPI standard is wrong. Explain to me how it is > > physically possible to have a device without NUMA affinity in a NUMA > > system? > &g

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-24 Thread Peter Zijlstra
On Tue, Sep 24, 2019 at 09:47:51AM +0200, Michal Hocko wrote: > On Mon 23-09-19 22:34:10, Peter Zijlstra wrote: > > On Mon, Sep 23, 2019 at 06:52:35PM +0200, Michal Hocko wrote: > [...] > > > I even the > > > ACPI standard is considering this optio

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Peter Zijlstra
On Mon, Sep 23, 2019 at 06:52:35PM +0200, Michal Hocko wrote: > On Mon 23-09-19 17:48:52, Peter Zijlstra wrote: > To the NUMA_NO_NODE itself. Your earlier email noted: > : > + > : > if ((unsigned)node >= nr_node_ids) { > : > printk(KERN_WARNING > : >

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Peter Zijlstra
On Mon, Sep 23, 2019 at 05:28:56PM +0200, Michal Hocko wrote: > On Mon 23-09-19 17:15:19, Peter Zijlstra wrote: > > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > > > index 4123100e..9859acb 100644 > > > --- a/arch/x86/mm/numa.c > > > +++ b/ar

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Peter Zijlstra
On Tue, Sep 17, 2019 at 08:48:54PM +0800, Yunsheng Lin wrote: > When passing the return value of dev_to_node() to cpumask_of_node() > without checking if the device's node id is NUMA_NO_NODE, there is > global-out-of-bounds detected by KASAN. > > From the discussion [1], NUMA_NO_NODE really means

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-05 Thread Peter Zijlstra
On Thu, Sep 05, 2019 at 11:43:05AM +0200, Peter Zijlstra wrote: > On Thu, Sep 05, 2019 at 07:26:22PM +1000, Aleksa Sarai wrote: > > On 2019-09-05, Peter Zijlstra wrote: > > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > > > +/** > > > &

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-05 Thread Peter Zijlstra
On Thu, Sep 05, 2019 at 07:26:22PM +1000, Aleksa Sarai wrote: > On 2019-09-05, Peter Zijlstra wrote: > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > > +/** > > > + * copy_struct_to_user: copy a struct to user space > > > + * @dst:

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-05 Thread Peter Zijlstra
On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > +/** > + * copy_struct_to_user: copy a struct to user space > + * @dst: Destination address, in user space. > + * @usize: Size of @dst struct. > + * @src: Source address, in kernel space. > + * @ksize: Size of @src struct. > + * >

[PATCH] x86/mm: Fix cpumask_of_node() error condition

2019-09-03 Thread Peter Zijlstra
cpumask_of_node() is a valid node_id. It however forgets to check for negative numbers. Fix this by explicitly casting to unsigned. (unsigned)node >= nr_node_ids verifies: 0 <= node < nr_node_ids Also ammend the error message to match the condition. Acked-by: Ingo Molnar Signed-off-

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-09-03 Thread Peter Zijlstra
On Tue, Sep 03, 2019 at 02:19:04PM +0800, Yunsheng Lin wrote: > On 2019/9/2 20:56, Peter Zijlstra wrote: > > On Mon, Sep 02, 2019 at 08:25:24PM +0800, Yunsheng Lin wrote: > >> On 2019/9/2 15:25, Peter Zijlstra wrote: > >>> On Mon, Sep 02, 2019 at 01:46:

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-09-02 Thread Peter Zijlstra
On Mon, Sep 02, 2019 at 08:22:52PM +0200, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > index f0dd8e38fee3..2caf204966a0 100644 > > --- a/drivers/base/core.c > > +++ b/drivers/base/core.c > > @

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-09-02 Thread Peter Zijlstra
On Mon, Sep 02, 2019 at 08:25:24PM +0800, Yunsheng Lin wrote: > On 2019/9/2 15:25, Peter Zijlstra wrote: > > On Mon, Sep 02, 2019 at 01:46:51PM +0800, Yunsheng Lin wrote: > >> On 2019/9/1 0:12, Peter Zijlstra wrote: > > > >>> 1) because even it is not set, the

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-09-02 Thread Peter Zijlstra
On Mon, Sep 02, 2019 at 01:46:51PM +0800, Yunsheng Lin wrote: > On 2019/9/1 0:12, Peter Zijlstra wrote: > > 1) because even it is not set, the device really does belong to a node. > > It is impossible a device will have magic uniform access to memory when > > CPUs can

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-08-31 Thread Peter Zijlstra
On Sat, Aug 31, 2019 at 06:09:39PM +0800, Yunsheng Lin wrote: > > > On 2019/8/31 16:55, Peter Zijlstra wrote: > > On Sat, Aug 31, 2019 at 01:58:16PM +0800, Yunsheng Lin wrote: > >> According to Section 6.2.14 from ACPI spec 6.3 [1], the setting > >> of proxi

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-08-31 Thread Peter Zijlstra
On Sat, Aug 31, 2019 at 01:58:16PM +0800, Yunsheng Lin wrote: > According to Section 6.2.14 from ACPI spec 6.3 [1], the setting > of proximity domain is optional, as below: > > This optional object is used to describe proximity domain > associations within a machine. _PXM evaluates to an integer

Re: [PATCH v4 2/3] locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs

2019-02-14 Thread Peter Zijlstra
tures use a single implementation of rwsem - rwsem-xadd.c. > > > > All references to RWSEM_GENERIC_SPINLOCK and RWSEM_XCHGADD_ALGORITHM > > in the code are removed. > > > > Suggested-by: Peter Zijlstra > > Signed-off-by: Waiman Long > > Note that this conflicts with "[PA

Re: [PATCH v4 0/3] locking/rwsem: Rwsem rearchitecture part 0

2019-02-14 Thread Peter Zijlstra
legacy rwsem-spinlock.c file and make all > the architectures use one single implementation of rwsem - rwsem-xadd.c. > > Waiman Long (3): > locking/rwsem: Remove arch specific rwsem files > locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all > archs > locking/r

Re: [PATCH v3 2/2] locking/rwsem: Optimize down_read_trylock()

2019-02-14 Thread Peter Zijlstra
On Wed, Feb 13, 2019 at 03:32:12PM -0500, Waiman Long wrote: > Modify __down_read_trylock() to optimize for an unlocked rwsem and make > it generate slightly better code. > > Before this patch, down_read_trylock: > >0x <+0>: callq 0x5 >0x0005 <+5>:

Re: [PATCH v2 2/2] locking/rwsem: Optimize down_read_trylock()

2019-02-12 Thread Peter Zijlstra
> 1 27,787 28,259 > 28,359 9,234 >From 1/2: 129,201 30,143 29,45828,615 30,172 29,201 2 6,807 13,299 1,171 7,725 15,025 1,804 > > On a ARM64 system, the performance results were: > >

Re: [PATCH] locking/rwsem: Remove arch specific rwsem files

2019-02-11 Thread Peter Zijlstra
On Mon, Feb 11, 2019 at 11:35:24AM -0500, Waiman Long wrote: > On 02/11/2019 06:58 AM, Peter Zijlstra wrote: > > Which is clearly worse. Now we can write that as: > > > > int __down_read_trylock2(unsigned long *l) > > { > > long tmp = READ_ONCE(*

Re: [PATCH] locking/rwsem: Remove arch specific rwsem files

2019-02-11 Thread Peter Zijlstra
On Sun, Feb 10, 2019 at 09:00:50PM -0500, Waiman Long wrote: > +static inline int __down_read_trylock(struct rw_semaphore *sem) > +{ > + long tmp; > + > + while ((tmp = atomic_long_read(>count)) >= 0) { > + if (tmp == atomic_long_cmpxchg_acquire(>count, tmp, > +

Re: [PATCH] locking/rwsem: Remove arch specific rwsem files

2019-02-11 Thread Peter Zijlstra
On Mon, Feb 11, 2019 at 10:40:44AM +0100, Peter Zijlstra wrote: > On Mon, Feb 11, 2019 at 10:36:01AM +0100, Peter Zijlstra wrote: > > On Sun, Feb 10, 2019 at 09:00:50PM -0500, Waiman Long wrote: > > > +static inline int __down_read_trylock(struct rw_semaphore *sem) > &g

Re: [PATCH] locking/rwsem: Remove arch specific rwsem files

2019-02-11 Thread Peter Zijlstra
On Mon, Feb 11, 2019 at 10:36:01AM +0100, Peter Zijlstra wrote: > On Sun, Feb 10, 2019 at 09:00:50PM -0500, Waiman Long wrote: > > +static inline int __down_read_trylock(struct rw_semaphore *sem) > > +{ > > + long tmp; > > + > > + while ((tmp

Re: [PATCH] locking/rwsem: Remove arch specific rwsem files

2019-02-11 Thread Peter Zijlstra
On Sun, Feb 10, 2019 at 09:00:50PM -0500, Waiman Long wrote: > diff --git a/kernel/locking/rwsem.h b/kernel/locking/rwsem.h > index bad2bca..067e265 100644 > --- a/kernel/locking/rwsem.h > +++ b/kernel/locking/rwsem.h > @@ -32,6 +32,26 @@ > # define DEBUG_RWSEMS_WARN_ON(c) > #endif > > +/* > +

Re: [PATCH-tip 15/22] locking/rwsem: Merge owner into count on x86-64

2019-02-07 Thread Peter Zijlstra
On Thu, Feb 07, 2019 at 02:07:19PM -0500, Waiman Long wrote: > On 32-bit architectures, there aren't enough bits to hold both. > 64-bit architectures, however, can have enough bits to do that. For > x86-64, the physical address can use up to 52 bits. That is 4PB of > memory. That leaves 12 bits

Re: [PATCH-tip 04/22] locking/rwsem: Remove arch specific rwsem files

2019-02-07 Thread Peter Zijlstra
On Thu, Feb 07, 2019 at 08:36:56PM +0100, Peter Zijlstra wrote: > On Thu, Feb 07, 2019 at 02:07:08PM -0500, Waiman Long wrote: > > > +static inline int __down_read_trylock(struct rw_semaphore *sem) > > +{ > > + long tmp; > > + > > + while ((

Re: [PATCH-tip 15/22] locking/rwsem: Merge owner into count on x86-64

2019-02-07 Thread Peter Zijlstra
On Thu, Feb 07, 2019 at 02:07:19PM -0500, Waiman Long wrote: > On 32-bit architectures, there aren't enough bits to hold both. > 64-bit architectures, however, can have enough bits to do that. For > x86-64, the physical address can use up to 52 bits. That is 4PB of > memory. That leaves 12 bits

Re: [PATCH-tip 04/22] locking/rwsem: Remove arch specific rwsem files

2019-02-07 Thread Peter Zijlstra
On Thu, Feb 07, 2019 at 02:07:08PM -0500, Waiman Long wrote: > +static inline int __down_read_trylock(struct rw_semaphore *sem) > +{ > + long tmp; > + > + while ((tmp = atomic_long_read(>count)) >= 0) { > + if (tmp == atomic_long_cmpxchg_acquire(>count, tmp, > +

Re: [PATCH v4 10/13] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-08 Thread Peter Zijlstra
On Tue, Jan 08, 2019 at 11:36:33AM -0500, Boris Ostrovsky wrote: > On 1/8/19 5:48 AM, Peter Zijlstra wrote: > > On the various exclude options; they are as follows (IIUC): > > > > - exclude_guest: we're a HV/host-kernel and we don't want the counter > >

Re: [PATCH v4 05/13] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE

2019-01-08 Thread Peter Zijlstra
On Tue, Jan 08, 2019 at 01:13:57PM +, Andrew Murray wrote: > On Tue, Jan 08, 2019 at 02:10:31PM +0100, Peter Zijlstra wrote: > > On Tue, Jan 08, 2019 at 01:07:41PM +, Andrew Murray wrote: > > > > > Yes I found lots of examples like this across the tree whil

Re: [PATCH v4 05/13] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE

2019-01-08 Thread Peter Zijlstra
On Tue, Jan 08, 2019 at 01:07:41PM +, Andrew Murray wrote: > Yes I found lots of examples like this across the tree whilst doing this > work. However I decided to initially start with simply removing duplicated > code as a result of adding this flag and attempting to preserve existing >

Re: [PATCH v4 10/13] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-08 Thread Peter Zijlstra
On Mon, Jan 07, 2019 at 04:27:27PM +, Andrew Murray wrote: > For drivers that do not support context exclusion let's advertise the > PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will > prevent us from handling events where any exclusion flags are set. > Let's also remove the now

Re: [PATCH v4 11/13] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-08 Thread Peter Zijlstra
On Mon, Jan 07, 2019 at 04:27:28PM +, Andrew Murray wrote: This patch has the exact same subject as the previous one.. that seems sub-optimal.

Re: [PATCH v4 05/13] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE

2019-01-08 Thread Peter Zijlstra
On Mon, Jan 07, 2019 at 04:27:22PM +, Andrew Murray wrote: > @@ -393,9 +386,8 @@ __hw_perf_event_init(struct perf_event *event) > /* >* Check whether we need to exclude the counter from certain modes. >*/ > + if (armpmu->set_event_filter && > +

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Peter Zijlstra
On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > > How about naming the thing: dependent_ptr() ? That is without any (r)mb > > implications at all. The address dependency is strictly weaker

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-22 Thread Peter Zijlstra
On Thu, Nov 22, 2018 at 12:21:43PM +, Andrew Murray wrote: > On Mon, Nov 19, 2018 at 02:08:00PM +0100, Peter Zijlstra wrote: > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > index 84530ab358c3..d76b724177b9 100644 > > --- a/kernel/events/core.c > >

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-19 Thread Peter Zijlstra
On Fri, Nov 16, 2018 at 10:24:03AM +, Andrew Murray wrote: > Many PMU drivers do not have the capability to exclude counting events > that occur in specific contexts such as idle, kernel, guest, etc. These > drivers indicate this by returning an error in their event_init upon > testing the

Re: [PATCH 01/10] perf/core: Add macro to test for event exclusion flags

2018-11-19 Thread Peter Zijlstra
On Fri, Nov 16, 2018 at 10:24:04AM +, Andrew Murray wrote: > Add a macro that tests if any of the perf event exclusion flags > are set on a given event. It is in fact an inline function, not a CPP macro. > Signed-off-by: Andrew Murray > --- > include/linux/perf_event.h | 9 + > 1

Re: [PATCH 0.5/5] alpha: remove custom dec_and_lock() implementation

2018-06-06 Thread Peter Zijlstra
On Wed, Jun 06, 2018 at 01:18:50PM +0200, Sebastian Andrzej Siewior wrote: > - atomic_add_unless() adds more memory barriers compared to the custom > assembly > I can't tell if the different memory barriers > are an issue but having the same barriers is probably good. refcount decrement needs

Re: [PATCH v6 02/11] locking/rwsem: Implement a new locking scheme

2017-10-11 Thread Peter Zijlstra
On Wed, Oct 11, 2017 at 02:58:02PM -0400, Waiman Long wrote: > On 10/11/2017 02:40 PM, Peter Zijlstra wrote: > > So I implemented rwsem-mutex (also qrwlock based) that puts > > > > (unsigned long)current | RWSEM_WRITER > > > > in the atomic_long_t rw_sema

Re: [PATCH v6 00/11] locking/rwsem: Rework rwsem-xadd & enable new rwsem features

2017-10-11 Thread Peter Zijlstra
On Wed, Oct 11, 2017 at 02:01:51PM -0400, Waiman Long wrote: > # of Patches Reader Writer > Applied Locking RateLocking Rate > > 0 5,155/5,155/5,155

Re: [PATCH v6 02/11] locking/rwsem: Implement a new locking scheme

2017-10-11 Thread Peter Zijlstra
On Wed, Oct 11, 2017 at 02:01:53PM -0400, Waiman Long wrote: > +/* > + * The definition of the atomic counter in the semaphore: > + * > + * Bit 0- writer locked bit > + * Bit 1- waiters present bit > + * Bits 2-7 - reserved > + * Bits 8-31 - 24-bit reader count > + * > + *

Re: [PATCH REBASED 0/6] rwsem: Implement down_read_killable()

2017-10-03 Thread Peter Zijlstra
On Fri, Sep 29, 2017 at 07:05:45PM +0300, Kirill Tkhai wrote: > The series introduces new down_read_killable() primitive, which > is similar to down_read(), but it may be interrupted by a signal. > The most touched is architectures code. Also, it marks a new user > of the primitive, which is

Re: [PATCH 2/7] rwsem-spinlock: Add killable versions of rwsem_down_read_failed()

2017-07-06 Thread Peter Zijlstra
On Mon, Jun 19, 2017 at 09:02:26PM +0300, Kirill Tkhai wrote: > Subject: [PATCH 2/7] rwsem-spinlock: Add killable versions of > rwsem_down_read_failed() > kernel/locking/rwsem-xadd.c | 33 ++--- Fixed that subject for your ;-) -- To unsubscribe from this list:

Re: [PATCH] atomic64: No need for CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

2016-09-08 Thread Peter Zijlstra
On Thu, Sep 08, 2016 at 09:28:18AM -0700, Vineet Gupta wrote: > This came to light when implementing native 64-bit atomics for ARCv2. > > The atomic64 self-test code uses CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE > to check whether atomic64_dec_if_positive() is available. > It seems it was needed

Re: [RFC PATCH-tip v2 4/6] locking/rwsem: move down rwsem_down_read_failed function

2016-06-15 Thread Peter Zijlstra
On Tue, Jun 14, 2016 at 06:48:07PM -0400, Waiman Long wrote: > Move the rwsem_down_read_failed() function down to below the optimistic > spinning section before enabling optimistic spinning for the readers. newline > There is no change in code. Changelog fails to explain the why part. -- To

Re: [RFC PATCH-tip v2 3/6] locking/rwsem: Enable count-based spinning on reader

2016-06-15 Thread Peter Zijlstra
On Tue, Jun 14, 2016 at 06:48:06PM -0400, Waiman Long wrote: > static bool rwsem_optimistic_spin(struct rw_semaphore *sem) > { > - bool taken = false; > + bool taken = false, can_spin; I would place the variables without assignment first. > + int loopcnt; > >

Re: [RFC PATCH-tip v2 2/6] locking/rwsem: Stop active read lock ASAP

2016-06-15 Thread Peter Zijlstra
On Tue, Jun 14, 2016 at 06:48:05PM -0400, Waiman Long wrote: > Currently, when down_read() fails, the active read locking isn't undone > until the rwsem_down_read_failed() function grabs the wait_lock. If the > wait_lock is contended, it may takes a while to get the lock. During > that period,

Re: [RFC PATCH-tip v2 1/6] locking/osq: Make lock/unlock proper acquire/release barrier

2016-06-15 Thread Peter Zijlstra
On Wed, Jun 15, 2016 at 04:04:46PM +0800, Boqun Feng wrote: > On Tue, Jun 14, 2016 at 06:48:04PM -0400, Waiman Long wrote: > > @@ -198,7 +198,7 @@ void osq_unlock(struct optimistic_spin_queue *lock) > > * Second most likely case. > > */ > > node = this_cpu_ptr(_node); > > - next =

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-03 Thread Peter Zijlstra
On Fri, Jun 03, 2016 at 06:13:39PM +0200, Peter Zijlstra wrote: > So I've been playing with this again because Jason's atomic_long_t > patches made a mess of things. > > (similar findings for both ia64 and s390, suggesting killing all > arch/*/include/asm/rwsem.h might actuyal

Re: [PATCH 2/2] sh, rwsem: drop superfluous arch specific implementation

2016-04-06 Thread Peter Zijlstra
On Wed, Apr 06, 2016 at 11:50:00AM +0200, Geert Uytterhoeven wrote: > Dag Peter, > > On Wed, Apr 6, 2016 at 11:26 AM, Peter Zijlstra <pet...@infradead.org> wrote: > > +Cc maintainers, linux-sh list is very high signal-to-noise as its been > > appropriated for renesas a