Re: [PATCH] mm: Make kvfree safe to call

2019-07-29 Thread Jason Gunthorpe
On Mon, Jul 29, 2019 at 11:28:30AM +0200, Michal Hocko wrote: > On Fri 26-07-19 14:01:37, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Since vfree() can sleep, calling kvfree() from contexts where sleeping > > is not permitted (eg holding a spinlock) is a bit of a lottery whe

Re: [PATCH] mm: Make kvfree safe to call

2019-07-29 Thread Michal Hocko
On Fri 26-07-19 14:01:37, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Since vfree() can sleep, calling kvfree() from contexts where sleeping > is not permitted (eg holding a spinlock) is a bit of a lottery whether > it'll work. Introduce kvfree_safe() for situations where we know

Re: [PATCH] mm: Make kvfree safe to call

2019-07-27 Thread Jeff Layton
On Fri, 2019-07-26 at 17:38 -0700, Matthew Wilcox wrote: > On Fri, Jul 26, 2019 at 05:25:03PM -0400, Jeff Layton wrote: > > On Fri, 2019-07-26 at 14:10 -0700, Alexander Duyck wrote: > > > On Fri, Jul 26, 2019 at 2:01 PM Matthew Wilcox > > > wrote: > > > > From: "Matthew Wilcox (Oracle)" > > > >

Re: [PATCH] mm: Make kvfree safe to call

2019-07-26 Thread Matthew Wilcox
On Fri, Jul 26, 2019 at 05:25:03PM -0400, Jeff Layton wrote: > On Fri, 2019-07-26 at 14:10 -0700, Alexander Duyck wrote: > > On Fri, Jul 26, 2019 at 2:01 PM Matthew Wilcox wrote: > > > From: "Matthew Wilcox (Oracle)" > > > > > > Since vfree() can sleep, calling kvfree() from contexts where sleep

Re: [PATCH] mm: Make kvfree safe to call

2019-07-26 Thread Jeff Layton
On Fri, 2019-07-26 at 14:10 -0700, Alexander Duyck wrote: > On Fri, Jul 26, 2019 at 2:01 PM Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Since vfree() can sleep, calling kvfree() from contexts where sleeping > > is not permitted (eg holding a spinlock) is a bit of a lottery

Re: [PATCH] mm: Make kvfree safe to call

2019-07-26 Thread Alexander Duyck
On Fri, Jul 26, 2019 at 2:01 PM Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > Since vfree() can sleep, calling kvfree() from contexts where sleeping > is not permitted (eg holding a spinlock) is a bit of a lottery whether > it'll work. Introduce kvfree_safe() for situations where

[PATCH] mm: Make kvfree safe to call

2019-07-26 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Since vfree() can sleep, calling kvfree() from contexts where sleeping is not permitted (eg holding a spinlock) is a bit of a lottery whether it'll work. Introduce kvfree_safe() for situations where we know we can sleep, but make kvfree() safe by default. Reporte