[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5419b70-97fd-b760-5343-066e9b5cb9f9@oracle.com>
Date: Thu, 21 Oct 2021 18:24:03 +0000
From: Jane Chu <jane.chu@...cle.com>
To: Christoph Hellwig <hch@...radead.org>
CC: "david@...morbit.com" <david@...morbit.com>,
"djwong@...nel.org" <djwong@...nel.org>,
"dan.j.williams@...el.com" <dan.j.williams@...el.com>,
"vishal.l.verma@...el.com" <vishal.l.verma@...el.com>,
"dave.jiang@...el.com" <dave.jiang@...el.com>,
"agk@...hat.com" <agk@...hat.com>,
"snitzer@...hat.com" <snitzer@...hat.com>,
"dm-devel@...hat.com" <dm-devel@...hat.com>,
"ira.weiny@...el.com" <ira.weiny@...el.com>,
"willy@...radead.org" <willy@...radead.org>,
"vgoyal@...hat.com" <vgoyal@...hat.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>
Subject: Re: [PATCH 3/6] pmem: pmem_dax_direct_access() to honor the
DAXDEV_F_RECOVERY flag
On 10/21/2021 4:23 AM, Christoph Hellwig wrote:
> On Wed, Oct 20, 2021 at 06:10:56PM -0600, Jane Chu wrote:
>> - if (unlikely(is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512,
>> - PFN_PHYS(nr_pages))))
>> + if (unlikely(!(flags & DAXDEV_F_RECOVERY) &&
>> + is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512,
>> + PFN_PHYS(nr_pages))))
>
> The indentation here is pretty messed up. Something like this would
> be move normal:
>
> if (unlikely(!(flags & DAXDEV_F_RECOVERY) &&
> is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512,
> PFN_PHYS(nr_pages)))) {
>
Will do.
> but if we don't really need the unlikely we could do an actually
> readable variant:
>
> if (!(flags & DAXDEV_F_RECOVERY) &&
> is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, PFN_PHYS(nr_pages)))
>
'unlikely' is needed because 'RWF_RECOVERY_DATA' flag is not
recommended for normal preadv2/pwritev2 usage, it's recommended
only if user is aware of or suspect poison in the range.
thanks,
-jane
Powered by blists - more mailing lists