Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-09-06 Thread Hanjun Guo
On 2019/9/6 21:43, Will Deacon wrote: > On Wed, Aug 28, 2019 at 02:03:37PM -0700, Kees Cook wrote: >> On Wed, Aug 28, 2019 at 03:14:40PM +0100, Will Deacon wrote: >>> On Wed, Aug 28, 2019 at 09:30:52AM +0200, Peter Zijlstra wrote: On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote:

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-09-06 Thread Will Deacon
On Wed, Aug 28, 2019 at 02:03:37PM -0700, Kees Cook wrote: > On Wed, Aug 28, 2019 at 03:14:40PM +0100, Will Deacon wrote: > > On Wed, Aug 28, 2019 at 09:30:52AM +0200, Peter Zijlstra wrote: > > > On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote: > > > > Will Deacon (6): > > > >

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-31 Thread Ard Biesheuvel
On Sat, 31 Aug 2019 at 22:02, Kees Cook wrote: > > On Sat, Aug 31, 2019 at 08:48:56PM +0300, Ard Biesheuvel wrote: > > It's been ~2 years since I looked at this code in detail, but IIRC, it > > looked like the inc-from-zero check was missing from the x86 > > implementation because it requires a

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-31 Thread Kees Cook
On Sat, Aug 31, 2019 at 08:48:56PM +0300, Ard Biesheuvel wrote: > It's been ~2 years since I looked at this code in detail, but IIRC, it > looked like the inc-from-zero check was missing from the x86 > implementation because it requires a load/compare/increment/store > sequence instead of a single

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-31 Thread Ard Biesheuvel
On Thu, 29 Aug 2019 at 00:03, Kees Cook wrote: > > On Wed, Aug 28, 2019 at 03:14:40PM +0100, Will Deacon wrote: > > On Wed, Aug 28, 2019 at 09:30:52AM +0200, Peter Zijlstra wrote: > > > On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote: > > > > Will Deacon (6): > > > > lib/refcount:

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-28 Thread Kees Cook
On Wed, Aug 28, 2019 at 03:14:40PM +0100, Will Deacon wrote: > On Wed, Aug 28, 2019 at 09:30:52AM +0200, Peter Zijlstra wrote: > > On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote: > > > Will Deacon (6): > > > lib/refcount: Define constants for saturation and max refcount values > > >

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-28 Thread Kees Cook
On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote: > Hi all, > > This is version two of the patches I previously posted here: > > https://lkml.kernel.org/r/20190802101000.12958-1-w...@kernel.org > > Changes since v1 include: > > * Avoid duplicate WARNs when incrementing from zero

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-28 Thread Will Deacon
On Wed, Aug 28, 2019 at 09:30:52AM +0200, Peter Zijlstra wrote: > On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote: > > Will Deacon (6): > > lib/refcount: Define constants for saturation and max refcount values > > lib/refcount: Ensure integer operands are treated as signed > >

Re: [PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-28 Thread Peter Zijlstra
On Tue, Aug 27, 2019 at 05:31:58PM +0100, Will Deacon wrote: > Will Deacon (6): > lib/refcount: Define constants for saturation and max refcount values > lib/refcount: Ensure integer operands are treated as signed > lib/refcount: Remove unused refcount_*_checked() variants > lib/refcount:

[PATCH v2 0/6] Rework REFCOUNT_FULL using atomic_fetch_* operations

2019-08-27 Thread Will Deacon
Hi all, This is version two of the patches I previously posted here: https://lkml.kernel.org/r/20190802101000.12958-1-w...@kernel.org Changes since v1 include: * Avoid duplicate WARNs when incrementing from zero * Some crude lktdm perf results to motivate the change: # perf stat -r