Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Logan Gunthorpe
On 22/05/18 11:25 AM, Dan Williams wrote: > As far as I can see by then it's too late, or we need to expose > release details to the caller which defeats the purpose of devm > semantics. In the dax/pmem case, I *think* it should be fine... devm_add_action_or_reset() only calls the action it is

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Logan Gunthorpe
On 22/05/18 11:25 AM, Dan Williams wrote: > As far as I can see by then it's too late, or we need to expose > release details to the caller which defeats the purpose of devm > semantics. In the dax/pmem case, I *think* it should be fine... devm_add_action_or_reset() only calls the action it is

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Dan Williams
On Tue, May 22, 2018 at 10:03 AM, Logan Gunthorpe wrote: > > > On 22/05/18 10:56 AM, Dan Williams wrote: >> On Tue, May 22, 2018 at 9:42 AM, Logan Gunthorpe wrote: >>> Hey Dan, >>> >>> On 21/05/18 06:07 PM, Dan Williams wrote: Without this change we

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Dan Williams
On Tue, May 22, 2018 at 10:03 AM, Logan Gunthorpe wrote: > > > On 22/05/18 10:56 AM, Dan Williams wrote: >> On Tue, May 22, 2018 at 9:42 AM, Logan Gunthorpe wrote: >>> Hey Dan, >>> >>> On 21/05/18 06:07 PM, Dan Williams wrote: Without this change we could fail to register the teardown of

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Logan Gunthorpe
On 22/05/18 10:56 AM, Dan Williams wrote: > On Tue, May 22, 2018 at 9:42 AM, Logan Gunthorpe wrote: >> Hey Dan, >> >> On 21/05/18 06:07 PM, Dan Williams wrote: >>> Without this change we could fail to register the teardown of >>> devm_memremap_pages(). The likelihood of

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Logan Gunthorpe
On 22/05/18 10:56 AM, Dan Williams wrote: > On Tue, May 22, 2018 at 9:42 AM, Logan Gunthorpe wrote: >> Hey Dan, >> >> On 21/05/18 06:07 PM, Dan Williams wrote: >>> Without this change we could fail to register the teardown of >>> devm_memremap_pages(). The likelihood of hitting this failure is

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Dan Williams
On Tue, May 22, 2018 at 9:42 AM, Logan Gunthorpe wrote: > Hey Dan, > > On 21/05/18 06:07 PM, Dan Williams wrote: >> Without this change we could fail to register the teardown of >> devm_memremap_pages(). The likelihood of hitting this failure is tiny >> as small memory

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Dan Williams
On Tue, May 22, 2018 at 9:42 AM, Logan Gunthorpe wrote: > Hey Dan, > > On 21/05/18 06:07 PM, Dan Williams wrote: >> Without this change we could fail to register the teardown of >> devm_memremap_pages(). The likelihood of hitting this failure is tiny >> as small memory allocations almost always

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Logan Gunthorpe
Hey Dan, On 21/05/18 06:07 PM, Dan Williams wrote: > Without this change we could fail to register the teardown of > devm_memremap_pages(). The likelihood of hitting this failure is tiny > as small memory allocations almost always succeed. However, the impact > of the failure is large given any

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Logan Gunthorpe
Hey Dan, On 21/05/18 06:07 PM, Dan Williams wrote: > Without this change we could fail to register the teardown of > devm_memremap_pages(). The likelihood of hitting this failure is tiny > as small memory allocations almost always succeed. However, the impact > of the failure is large given any

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Christoph Hellwig
On Mon, May 21, 2018 at 03:35:24PM -0700, Dan Williams wrote: > The last step before devm_memremap_pages() returns success is to > allocate a release action to tear the entire setup down. However, the > result from devm_add_action() is not checked. > > Checking the error also means that we need

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-22 Thread Christoph Hellwig
On Mon, May 21, 2018 at 03:35:24PM -0700, Dan Williams wrote: > The last step before devm_memremap_pages() returns success is to > allocate a release action to tear the entire setup down. However, the > result from devm_add_action() is not checked. > > Checking the error also means that we need

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-21 Thread Dan Williams
[ resend as the last attempt dropped all the cc's ] On Mon, May 21, 2018 at 4:10 PM, Andrew Morton wrote: > On Mon, 21 May 2018 15:35:24 -0700 Dan Williams > wrote: > >> The last step before devm_memremap_pages() returns success is to >>

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-21 Thread Dan Williams
[ resend as the last attempt dropped all the cc's ] On Mon, May 21, 2018 at 4:10 PM, Andrew Morton wrote: > On Mon, 21 May 2018 15:35:24 -0700 Dan Williams > wrote: > >> The last step before devm_memremap_pages() returns success is to >> allocate a release action to tear the entire setup down.

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-21 Thread Andrew Morton
On Mon, 21 May 2018 15:35:24 -0700 Dan Williams wrote: > The last step before devm_memremap_pages() returns success is to > allocate a release action to tear the entire setup down. However, the > result from devm_add_action() is not checked. > > Checking the error

Re: [PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-21 Thread Andrew Morton
On Mon, 21 May 2018 15:35:24 -0700 Dan Williams wrote: > The last step before devm_memremap_pages() returns success is to > allocate a release action to tear the entire setup down. However, the > result from devm_add_action() is not checked. > > Checking the error also means that we need to

[PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-21 Thread Dan Williams
The last step before devm_memremap_pages() returns success is to allocate a release action to tear the entire setup down. However, the result from devm_add_action() is not checked. Checking the error also means that we need to handle the fact that the percpu_ref may not be killed by the time

[PATCH 2/5] mm, devm_memremap_pages: handle errors allocating final devres action

2018-05-21 Thread Dan Williams
The last step before devm_memremap_pages() returns success is to allocate a release action to tear the entire setup down. However, the result from devm_add_action() is not checked. Checking the error also means that we need to handle the fact that the percpu_ref may not be killed by the time