Legacy pmem namespaces lost support for the "resource" attribute when
the code was cleaned up to put the permission visibility in the
declaration. Restore this by listing 'resource' in the default
attributes.
A new ndctl regression test for pfn_to_online_page() corner cases builds
on this fix.
Given 'struct dev_pagemap' spans both data pages and metadata pages be
careful to consult the altmap if present to delineate metadata. In fact
the pfn_first() helper already identifies the first valid data pfn, so
export that helper for other code paths via pgmap_pfn_valid().
Other usage of
The conversion to move pfn_to_online_page() internal to
soft_offline_page() missed that the get_user_pages() reference taken by
the madvise() path needs to be dropped when pfn_to_online_page() fails.
Note the direct sysfs-path to soft_offline_page() does not perform a
get_user_pages() lookup.
While pfn_to_online_page() is able to determine pfn_valid() at
subsection granularity it is not able to reliably determine if a given
pfn is also online if the section is mixes ZONE_{NORMAL,MOVABLE} with
ZONE_DEVICE. This means that pfn_to_online_page() may return invalid
@page objects. For
pfn_section_valid() determines pfn validity on subsection granularity
where pfn_valid() may be limited to coarse section granularity.
Explicitly validate subsections after pfn_valid() succeeds.
Fixes: b13bc35193d9 ("mm/hotplug: invalid PFNs from pfn_to_online_page()")
Cc: Qian Cai
Cc: Michal
Changes since v2 [1]:
- Collect some reviewed-by's from David and Oscar
- Rework subsection validity to include pfn_valid() gated by
CONFIG_HAVE_ARCH_PFN_VALID (David, Oscar)
- Introduce pgmap_pfn_valid() to validate metadata vs data in a pgmap (David)
! Kill put_ref_page(): the extra "if
pfn_to_online_page() is already too large to be a macro or an inline
function. In anticipation of further logic changes / growth, move it out
of line.
No functional change, just code movement.
Reported-by: Michal Hocko
Reviewed-by: David Hildenbrand
Reviewed-by: Oscar Salvador
Signed-off-by:
Test soft-offline injection into PMEM namespace metadata and user mapped
space. Both attempts should fail on kernels with a pfn_to_online_page()
implementation that considers subsection ZONE_DEVICE ranges.
Signed-off-by: Dan Williams
---
test/dax-poison.c | 19 +++
The test_dax_remap() test is a regression check for mishandling of mremap()
in the presence of pmd_devmap(). My understanding is that it was a fuzzing
condition not something an application would want to do in practice.
On recent kernels with commit 73d5e0629919 ("mremap: check if it's possible
There are no cleanup actions to take in test_dax_remap(), and it is already
inconsistent for having a single return point, so remove the out label.
Signed-off-by: Dan Williams
---
test/dax-pmd.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/test/dax-pmd.c
../test/libndctl.c:989:2: warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
989 | unsigned long long expect_table[][2] = {
| ^~~~
...just move the declaration a few lines up.
Signed-off-by: Dan Williams
---
test/libndctl.c | 12 ++--
Vishal,
Here's a collection of test updates. It adds support for regression
testing pfn_to_online_page() which suffered from a lack of precision in
mixed zone memory-sections. Updates the mremap() regression to accept
failure as an option (the behavior in v5.11-rc1+). Fixes a warning, and
ditches
[ notify Vishal ]
On Sat, Jan 9, 2021 at 9:37 AM redhairer wrote:
>
> From: Redhairer Li
>
> Translate the status codes of the result of JEDEC Byte Addressable Energy
> Backed
> DSM to generic errno style error codes.
>
> Signed-off-by: Li Redhairer
Looks good to me:
Reviewed-by: Dan
Hi Redhairer, sorry for the long delay circling back to this...
On Mon, Apr 27, 2020 at 6:10 PM Li, Redhairer wrote:
>
> If make this return 0 in the case when size is zero, then seed device will be
> counted in due to
> case ACTION_DISABLE:
> rc = ndctl_namespace_disable_safe(ndns);
> if (rc
On Tue, Jan 12, 2021 at 1:53 AM David Hildenbrand wrote:
>
> On 12.01.21 10:34, Dan Williams wrote:
> > pfn_section_valid() determines pfn validity on subsection granularity.
> >
> > pfn_valid_within() internally uses pfn_section_valid(), but gates it
> > with early_section() to preserve the
On Tue, Jan 12, 2021 at 1:54 AM Oscar Salvador wrote:
>
> On Tue, Jan 12, 2021 at 01:34:58AM -0800, Dan Williams wrote:
> > The conversion to move pfn_to_online_page() internal to
> > soft_offline_page() missed that the get_user_pages() reference needs to
> > be dropped when pfn_to_online_page()
From: Zhongwei Cai
> Sent: 12 January 2021 13:45
..
> The overhead mainly consists of two parts. The first is constructing
> struct iov_iter and iterating it (i.e., new_sync, _copy_mc_to_iter and
> iov_iter_init). The second is the dax io mechanism provided by VFS (i.e.,
> dax_iomap_rw,
From: Randy Dunlap
[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.
Provide copy_user_page() in .
../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit
From: Randy Dunlap
[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.
Provide copy_user_page() in .
../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit
From: Randy Dunlap
[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.
Provide copy_user_page() in .
../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit
From: Randy Dunlap
[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.
Provide copy_user_page() in .
../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit
From: Randy Dunlap
[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.
Provide copy_user_page() in .
../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit
From: Randy Dunlap
[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.
Provide copy_user_page() in .
../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit
On 2021/1/7 上午1:14, Jan Kara wrote:
On Thu 31-12-20 00:55:59, Shiyang Ruan wrote:
With the support of ->rmap(), it is possible to obtain the superblock on
a mapped device.
If a pmem device is used as one target of mapped device, we cannot
obtain its superblock directly. With the help of
On Tue, Jan 12, 2021 at 01:34:53AM -0800, Dan Williams wrote:
> While pfn_to_online_page() is able to determine pfn_valid() at
> subsection granularity it is not able to reliably determine if a given
> pfn is also online if the section is mixes ZONE_{NORMAL,MOVABLE} with
> ZONE_DEVICE. This means
On Tue, Jan 12, 2021 at 10:53:17AM +0100, David Hildenbrand wrote:
> That's not sufficient for alternative implementations of pfn_valid().
>
> You still need some kind of pfn_valid(pfn) for alternative versions of
> pfn_valid(). Consider arm64 memory holes in the memmap. See their
> current (yet
On Tue, Jan 12, 2021 at 01:34:42AM -0800, Dan Williams wrote:
> pfn_to_online_page() is already too large to be a macro or an inline
> function. In anticipation of further logic changes / growth, move it out
> of line.
>
> No functional change, just code movement.
>
> Cc: David Hildenbrand
>
On 12.01.21 10:34, Dan Williams wrote:
> The conversion to move pfn_to_online_page() internal to
> soft_offline_page() missed that the get_user_pages() reference needs to
> be dropped when pfn_to_online_page() fails.
>
> When soft_offline_page() is handed a pfn_valid() &&
> !pfn_to_online_page()
On 12.01.21 10:34, Dan Williams wrote:
> While pfn_to_online_page() is able to determine pfn_valid() at
> subsection granularity it is not able to reliably determine if a given
> pfn is also online if the section is mixes ZONE_{NORMAL,MOVABLE} with
> ZONE_DEVICE. This means that
On Tue, Jan 12, 2021 at 01:34:58AM -0800, Dan Williams wrote:
> The conversion to move pfn_to_online_page() internal to
> soft_offline_page() missed that the get_user_pages() reference needs to
> be dropped when pfn_to_online_page() fails.
I would be more specific here wrt. get_user_pages
On 12.01.21 10:34, Dan Williams wrote:
> pfn_section_valid() determines pfn validity on subsection granularity.
>
> pfn_valid_within() internally uses pfn_section_valid(), but gates it
> with early_section() to preserve the traditional behavior of pfn_valid()
> before subsection support was
On 12.01.21 10:34, Dan Williams wrote:
> pfn_to_online_page() is already too large to be a macro or an inline
> function. In anticipation of further logic changes / growth, move it out
> of line.
>
> No functional change, just code movement.
>
> Cc: David Hildenbrand
> Reported-by: Michal Hocko
Legacy pmem namespaces lost support for the "resource" attribute when
the code was cleaned up to put the permission visibility in the
declaration. Restore this by listing 'resource' in the default
attributes.
A new ndctl regression test for pfn_to_online_page() corner cases builds
on this fix.
The conversion to move pfn_to_online_page() internal to
soft_offline_page() missed that the get_user_pages() reference needs to
be dropped when pfn_to_online_page() fails.
When soft_offline_page() is handed a pfn_valid() &&
!pfn_to_online_page() pfn the kernel hangs at dax-device shutdown due to
While pfn_to_online_page() is able to determine pfn_valid() at
subsection granularity it is not able to reliably determine if a given
pfn is also online if the section is mixes ZONE_{NORMAL,MOVABLE} with
ZONE_DEVICE. This means that pfn_to_online_page() may return invalid
@page objects. For
pfn_section_valid() determines pfn validity on subsection granularity.
pfn_valid_within() internally uses pfn_section_valid(), but gates it
with early_section() to preserve the traditional behavior of pfn_valid()
before subsection support was added.
pfn_to_online_page() wants the explicit
pfn_to_online_page() is already too large to be a macro or an inline
function. In anticipation of further logic changes / growth, move it out
of line.
No functional change, just code movement.
Cc: David Hildenbrand
Reported-by: Michal Hocko
Signed-off-by: Dan Williams
---
Changes since v1 [1]:
- Clarify the failing condition in patch 3 (Michal)
- Clarify how subsection collisions manifest in shipping systems
(Michal)
- Use zone_idx() (Michal)
- Move section_taint_zone_device() conditions to
move_pfn_range_to_zone() (Michal)
- Fix pfn_to_online_page() to account
38 matches
Mail list logo