Re: [PATCH 2/2] mm: fix dev_pagemap reference counting around get_dev_pagemap

Dan Williams
2017-12-06T22:48:10Z

On Wed, Dec 6, 2017 at 2:44 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Tue, Dec 05, 2017 at 06:43:36PM -0800, Dan Williams wrote:
>> I don't think we need this change, but perhaps the reasoning should be
>> added to the code as a comment... details below.
>
> Hmm, looks like we are ok at least. But even if it's not a correctness
> issue there is no good point in decrementing and incrementing the
> reference count every time.

True, we can take it once and drop it at the end when all the related
page references have been taken.