From: Wei Yang <richardw.yang@linux.intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <zwisler@kernel.org>,
linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH 1/2] libnvdimm, pfn: use size is enough
Date: Wed, 13 Feb 2019 09:27:07 +0800 [thread overview]
Message-ID: <20190213012707.GA4470@richard> (raw)
In-Reply-To: <CAPcyv4hn2JKAaH2YX0Ywc0Qa-_kHGk9QaqnO+odzHFzchbZVzA@mail.gmail.com>
On Tue, Jan 22, 2019 at 05:28:39PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 6:49 PM Wei Yang <richardw.yang@linux.intel.com> wrote:
>>
>> When trying to see whether current nd_region intersects with others, we
>> have already calculated the *size* to be expanded to SECTION size.
>>
>> So just pass size is enough.
>>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>> drivers/nvdimm/pfn_devs.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
>> index becf0bb481b3..5eca050b3660 100644
>> --- a/drivers/nvdimm/pfn_devs.c
>> +++ b/drivers/nvdimm/pfn_devs.c
>> @@ -686,7 +686,7 @@ static void trim_pfn_device(struct nd_pfn *nd_pfn, u32 *start_pad, u32 *end_trun
>> if (region_intersects(start, size, IORESOURCE_SYSTEM_RAM,
>> IORES_DESC_NONE) == REGION_MIXED
>> || !IS_ALIGNED(end, nd_pfn->align)
>> - || nd_region_conflict(nd_region, start, size + adjust))
>> + || nd_region_conflict(nd_region, start, size))
>
Hi, Dan,
I got a question about the trim on start.
We check the alignment of nd_pfn->align on end, while we don't do this for
start. I lost why we would like to have this behavior.
Would we align start with nd_pfn->align too?
>Good catch, thanks. I fixed up the changelog a bit and applied this:
>
> libnvdimm, pfn: Fix over-trim in trim_pfn_device()
>
> When trying to see whether current nd_region intersects with others,
> trim_pfn_device() has already calculated the *size* to be expanded to
> SECTION size.
>
> Do not double append 'adjust' to 'size' when calculating whether the end
> of a region collides with the next pmem region.
>
> Fixes: ae86cbfef381 "libnvdimm, pfn: Pad pfn namespaces relative
>to other regions"
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
--
Wei Yang
Help you, Help me
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
prev parent reply other threads:[~2019-02-13 1:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 2:48 [PATCH 1/2] libnvdimm, pfn: use size is enough Wei Yang
2019-01-22 2:48 ` [PATCH 2/2] libnvdimm, pfn: use PAGE_SIZE to calculate npfns Wei Yang
2019-01-23 1:27 ` Dan Williams
2019-01-23 6:40 ` Wei Yang
2019-01-23 1:28 ` [PATCH 1/2] libnvdimm, pfn: use size is enough Dan Williams
2019-01-23 2:38 ` Wei Yang
2019-02-13 1:27 ` Wei Yang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190213012707.GA4470@richard \
--to=richardw.yang@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.org \
--cc=zwisler@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).