Re: [RFC PATCH] z3fold: prevent reclaim/free race for headless pages

2021-02-16 Thread Greg Kroah-Hartman
On Tue, Feb 16, 2021 at 02:04:20AM -0800, Tom Hebb wrote: > On Tue, Feb 16, 2021 at 1:21 AM Greg Kroah-Hartman > wrote: > > > > On Tue, Feb 16, 2021 at 12:44:40AM -0800, Thomas Hebb wrote: > > > commit ca0246bb97c2 ("z3fold: fix possible reclaim races") introduced > > > the PAGE_CLAIMED flag "to a

Re: [RFC PATCH] z3fold: prevent reclaim/free race for headless pages

2021-02-16 Thread Tom Hebb
On Tue, Feb 16, 2021 at 1:21 AM Greg Kroah-Hartman wrote: > > On Tue, Feb 16, 2021 at 12:44:40AM -0800, Thomas Hebb wrote: > > commit ca0246bb97c2 ("z3fold: fix possible reclaim races") introduced > > the PAGE_CLAIMED flag "to avoid racing on a z3fold 'headless' page > > release." By atomically te

Re: [RFC PATCH] z3fold: prevent reclaim/free race for headless pages

2021-02-16 Thread Vitaly Wool
Hi Thomas, On Tue, Feb 16, 2021 at 9:44 AM Thomas Hebb wrote: > > commit ca0246bb97c2 ("z3fold: fix possible reclaim races") introduced > the PAGE_CLAIMED flag "to avoid racing on a z3fold 'headless' page > release." By atomically testing and setting the bit in each of > z3fold_free() and z3fold_

Re: [RFC PATCH] z3fold: prevent reclaim/free race for headless pages

2021-02-16 Thread Greg Kroah-Hartman
On Tue, Feb 16, 2021 at 12:44:40AM -0800, Thomas Hebb wrote: > commit ca0246bb97c2 ("z3fold: fix possible reclaim races") introduced > the PAGE_CLAIMED flag "to avoid racing on a z3fold 'headless' page > release." By atomically testing and setting the bit in each of > z3fold_free() and z3fold_recla

[RFC PATCH] z3fold: prevent reclaim/free race for headless pages

2021-02-16 Thread Thomas Hebb
commit ca0246bb97c2 ("z3fold: fix possible reclaim races") introduced the PAGE_CLAIMED flag "to avoid racing on a z3fold 'headless' page release." By atomically testing and setting the bit in each of z3fold_free() and z3fold_reclaim_page(), a double-free was avoided. However, commit 746d179b0e66 (