[RFC PATCH] drivers/dax: Allow to include DEV_DAX_PMEM as builtin
by Aneesh Kumar K.V
This move the dependency to DEV_DAX_PMEM_COMPAT such that only
if DEV_DAX_PMEM is built as module we can allow the compat support.
This allows to test the new code easily in a emulation setup where we
often build things without module support.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
---
drivers/dax/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig
index 5ef624fe3934..e582e088b48c 100644
--- a/drivers/dax/Kconfig
+++ b/drivers/dax/Kconfig
@@ -23,7 +23,6 @@ config DEV_DAX
config DEV_DAX_PMEM
tristate "PMEM DAX: direct access to persistent memory"
depends on LIBNVDIMM && NVDIMM_DAX && DEV_DAX
- depends on m # until we can kill DEV_DAX_PMEM_COMPAT
default DEV_DAX
help
Support raw access to persistent memory. Note that this
@@ -50,7 +49,7 @@ config DEV_DAX_KMEM
config DEV_DAX_PMEM_COMPAT
tristate "PMEM DAX: support the deprecated /sys/class/dax interface"
- depends on DEV_DAX_PMEM
+ depends on DEV_DAX_PMEM=m
default DEV_DAX_PMEM
help
Older versions of the libdaxctl library expect to find all
--
2.20.1
1 year, 9 months
[PATCH 0/6] mm/devm_memremap_pages: Fix page release race
by Dan Williams
Logan audited the devm_memremap_pages() shutdown path and noticed that
it was possible to proceed to arch_remove_memory() before all
potential page references have been reaped.
Introduce a new ->cleanup() callback to do the work of waiting for any
straggling page references and then perform the percpu_ref_exit() in
devm_memremap_pages_release() context.
For p2pdma this involves some deeper reworks to reference count
resources on a per-instance basis rather than a per pci-device basis. A
modified genalloc api is introduced to convey a driver-private pointer
through gen_pool_{alloc,free}() interfaces. Also, a
devm_memunmap_pages() api is introduced since p2pdma does not
auto-release resources on a setup failure.
The dax and pmem changes pass the nvdimm unit tests, but the hmm and
p2pdma changes are compile-tested only.
Thoughts on the api changes?
I'm targeting to land this through Andrew's tree. 0day has chewed on
this for a day and reported no issues so far.
---
Dan Williams (6):
drivers/base/devres: Introduce devm_release_action()
mm/devm_memremap_pages: Introduce devm_memunmap_pages
pci/p2pdma: Fix the gen_pool_add_virt() failure path
lib/genalloc: Introduce chunk owners
pci/p2pdma: Track pgmap references per resource, not globally
mm/devm_memremap_pages: Fix final page put race
drivers/base/devres.c | 24 ++++++++
drivers/dax/device.c | 13 +----
drivers/nvdimm/pmem.c | 17 +++++-
drivers/pci/p2pdma.c | 105 +++++++++++++++++++++++--------------
include/linux/device.h | 1
include/linux/genalloc.h | 55 +++++++++++++++++--
include/linux/memremap.h | 8 +++
kernel/memremap.c | 23 ++++++--
lib/genalloc.c | 51 +++++++++---------
mm/hmm.c | 14 +----
tools/testing/nvdimm/test/iomap.c | 2 +
11 files changed, 209 insertions(+), 104 deletions(-)
1 year, 10 months
(no subject)
by 邀请函
-------- 转发邮件信息 --------
发件人:mivczrufz(a)exu.net
发送日期:2019-3-29 8:36:49
收件人:linux-nvdimm(a)lists.01.org
~附~件~内~容~请~您~查~阅~
8:36:49
1 year, 10 months
[PATCH v2 1/3] ndctl: fix load-keys for user master-key
by Dave Jiang
load-keys incorrectly assumes that all keys have TPM handles. TPM handle is
only for trusted-keys. Fix in order to allow user master-key to operate.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
v2:
- Make output go to stderr. (Dan)
ndctl/load-keys.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ndctl/load-keys.c b/ndctl/load-keys.c
index 8e4998f2..7d86a94b 100644
--- a/ndctl/load-keys.c
+++ b/ndctl/load-keys.c
@@ -213,10 +213,8 @@ static int load_keys(struct loadkeys *lk_ctx, const char *keypath,
if (!tpmhandle) {
rc = check_tpm_handle(lk_ctx);
- if (rc < 0) {
- rc = -errno;
- goto erropen;
- }
+ if (rc < 0)
+ fprintf(stderr, "No TPM handle discovered.\n");
}
rc = load_master_key(lk_ctx, param.key_path);
1 year, 10 months
[PATCH 1/3] ndctl: fix load-keys for user master-key
by Dave Jiang
load-keys incorrectly assumes that all keys have TPM handles. TPM handle is
only for trusted-keys. Fix in order to allow user master-key work.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
ndctl/load-keys.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ndctl/load-keys.c b/ndctl/load-keys.c
index 8e4998f2..19380152 100644
--- a/ndctl/load-keys.c
+++ b/ndctl/load-keys.c
@@ -213,10 +213,8 @@ static int load_keys(struct loadkeys *lk_ctx, const char *keypath,
if (!tpmhandle) {
rc = check_tpm_handle(lk_ctx);
- if (rc < 0) {
- rc = -errno;
- goto erropen;
- }
+ if (rc < 0)
+ printf("No TPM handle discovered.\n");
}
rc = load_master_key(lk_ctx, param.key_path);
1 year, 10 months
[PATCH RT] nvdimm: make lane acquirement RT aware
by Yongxin Liu
Currently, nvdimm driver isn't RT compatible.
nd_region_acquire_lane() disables preemption with get_cpu() which
causes "scheduling while atomic" spews on RT, when using fio to test
pmem as block device.
In this change, we replace get_cpu/put_cpu with local_lock_cpu/
local_unlock_cpu, and introduce per CPU variable "ndl_local_lock".
Due to preemption on RT, this lock can avoid race condition for the
same lane on the same CPU. When CPU number is greater than the lane
number, lane can be shared among CPUs. "ndl_lock->lock" is used to
protect the lane in this situation.
This patch is derived from Dan Williams and Pankaj Gupta's proposal from
https://www.mail-archive.com/linux-nvdimm@lists.01.org/msg13359.html
and https://www.spinics.net/lists/linux-rt-users/msg20280.html.
Many thanks to them.
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Pankaj Gupta <pagupta(a)redhat.com>
Cc: linux-rt-users <linux-rt-users(a)vger.kernel.org>
Cc: linux-nvdimm <linux-nvdimm(a)lists.01.org>
Signed-off-by: Yongxin Liu <yongxin.liu(a)windriver.com>
---
drivers/nvdimm/region_devs.c | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index fa37afcd43ff..6c5388cf2477 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -18,9 +18,13 @@
#include <linux/sort.h>
#include <linux/io.h>
#include <linux/nd.h>
+#include <linux/locallock.h>
#include "nd-core.h"
#include "nd.h"
+/* lock for tasks on the same CPU to sequence the access to the lane */
+static DEFINE_LOCAL_IRQ_LOCK(ndl_local_lock);
+
/*
* For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is
* irrelevant.
@@ -935,18 +939,15 @@ int nd_blk_region_init(struct nd_region *nd_region)
unsigned int nd_region_acquire_lane(struct nd_region *nd_region)
{
unsigned int cpu, lane;
+ struct nd_percpu_lane *ndl_lock, *ndl_count;
- cpu = get_cpu();
- if (nd_region->num_lanes < nr_cpu_ids) {
- struct nd_percpu_lane *ndl_lock, *ndl_count;
+ cpu = local_lock_cpu(ndl_local_lock);
- lane = cpu % nd_region->num_lanes;
- ndl_count = per_cpu_ptr(nd_region->lane, cpu);
- ndl_lock = per_cpu_ptr(nd_region->lane, lane);
- if (ndl_count->count++ == 0)
- spin_lock(&ndl_lock->lock);
- } else
- lane = cpu;
+ lane = cpu % nd_region->num_lanes;
+ ndl_count = per_cpu_ptr(nd_region->lane, cpu);
+ ndl_lock = per_cpu_ptr(nd_region->lane, lane);
+ if (ndl_count->count++ == 0)
+ spin_lock(&ndl_lock->lock);
return lane;
}
@@ -954,17 +955,14 @@ EXPORT_SYMBOL(nd_region_acquire_lane);
void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane)
{
- if (nd_region->num_lanes < nr_cpu_ids) {
- unsigned int cpu = get_cpu();
- struct nd_percpu_lane *ndl_lock, *ndl_count;
-
- ndl_count = per_cpu_ptr(nd_region->lane, cpu);
- ndl_lock = per_cpu_ptr(nd_region->lane, lane);
- if (--ndl_count->count == 0)
- spin_unlock(&ndl_lock->lock);
- put_cpu();
- }
- put_cpu();
+ struct nd_percpu_lane *ndl_lock, *ndl_count;
+ unsigned int cpu = smp_processor_id();
+
+ ndl_count = per_cpu_ptr(nd_region->lane, cpu);
+ ndl_lock = per_cpu_ptr(nd_region->lane, lane);
+ if (--ndl_count->count == 0)
+ spin_unlock(&ndl_lock->lock);
+ local_unlock_cpu(ndl_local_lock);
}
EXPORT_SYMBOL(nd_region_release_lane);
--
2.14.4
1 year, 10 months
[RFC PATCH 00/68] VFS: Convert a bunch of filesystems to the new mount API
by David Howells
Hi Al,
Here's a set of patches that converts a bunch (but not yet all!) to the new
mount API. To this end, it makes the following changes:
(1) Provides a convenience member in struct fs_context that is OR'd into
sb->s_iflags by sget_fc().
(2) Provides a convenience helper function, vfs_init_pseudo_fs_context(),
for doing most of the work in mounting a pseudo filesystem.
(3) Provides a convenience helper function, vfs_get_block_super(), for
doing the work in setting up a block-based superblock.
(4) Improves the handling of fd-type parameters.
(5) Moves some of the subtype handling int fuse.
(6) Provides a convenience helper function, vfs_get_mtd_super(), for
doing the work in setting up an MTD device-based superblock.
(7) Kills off mount_pseudo(), mount_pseudo_xattr(), mount_ns(),
sget_userns(), mount_mtd(), mount_single().
(8) Converts a slew of filesystems to use the mount API.
(9) Fixes a bug in hypfs.
The patches can be found here also:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
on branch:
mount-api-viro
David
---
Andrew Price (1):
gfs2: Convert gfs2 to fs_context
David Howells (66):
vfs: Update mount API docs
vfs: Fix refcounting of filenames in fs_parser
vfs: Provide sb->s_iflags settings in fs_context struct
vfs: Provide a mount_pseudo-replacement for the new mount API
vfs: Convert aio to use the new mount API
vfs: Convert anon_inodes to use the new mount API
vfs: Convert bdev to use the new mount API
vfs: Convert nsfs to use the new mount API
vfs: Convert pipe to use the new mount API
vfs: Convert zsmalloc to use the new mount API
vfs: Convert sockfs to use the new mount API
vfs: Convert dax to use the new mount API
vfs: Convert drm to use the new mount API
vfs: Convert ia64 perfmon to use the new mount API
vfs: Convert cxl to use the new mount API
vfs: Convert ocxlflash to use the new mount API
vfs: Convert virtio_balloon to use the new mount API
vfs: Convert btrfs_test to use the new mount API
vfs: Kill off mount_pseudo() and mount_pseudo_xattr()
vfs: Use sget_fc() for pseudo-filesystems
vfs: Convert binderfs to use the new mount API
vfs: Convert nfsctl to use the new mount API
vfs: Convert rpc_pipefs to use the new mount API
vfs: Kill mount_ns()
vfs: Kill sget_userns()
vfs: Convert binfmt_misc to use the new mount API
vfs: Convert configfs to use the new mount API
vfs: Convert efivarfs to use the new mount API
vfs: Convert fusectl to use the new mount API
vfs: Convert qib_fs/ipathfs to use the new mount API
vfs: Convert ibmasmfs to use the new mount API
vfs: Convert oprofilefs to use the new mount API
vfs: Convert gadgetfs to use the new mount API
vfs: Convert xenfs to use the new mount API
vfs: Convert openpromfs to use the new mount API
vfs: Convert apparmorfs to use the new mount API
vfs: Convert securityfs to use the new mount API
vfs: Convert selinuxfs to use the new mount API
vfs: Convert smackfs to use the new mount API
vfs: Convert ramfs, shmem, tmpfs, devtmpfs, rootfs to use the new mount API
vfs: Create fs_context-aware mount_bdev() replacement
vfs: Make fs_parse() handle fs_param_is_fd-type params better
vfs: Convert fuse to use the new mount API
vfs: Move the subtype parameter into fuse
mtd: Provide fs_context-aware mount_mtd() replacement
vfs: Convert romfs to use the new mount API
vfs: Convert cramfs to use the new mount API
vfs: Convert jffs2 to use the new mount API
mtd: Kill mount_mtd()
vfs: Convert squashfs to use the new mount API
vfs: Convert ceph to use the new mount API
vfs: Convert functionfs to use the new mount API
vfs: Add a single-or-reconfig keying to vfs_get_super()
vfs: Convert debugfs to use the new mount API
vfs: Convert tracefs to use the new mount API
vfs: Convert pstore to use the new mount API
hypfs: Fix error number left in struct pointer member
vfs: Convert hypfs to use the new mount API
vfs: Convert spufs to use the new mount API
vfs: Kill mount_single()
vfs: Convert coda to use the new mount API
vfs: Convert autofs to use the new mount API
vfs: Convert devpts to use the new mount API
vfs: Convert bpf to use the new mount API
vfs: Convert ubifs to use the new mount API
vfs: Convert orangefs to use the new mount API
Masahiro Yamada (1):
kbuild: skip sub-make for in-tree build with GNU Make 4.x
Documentation/filesystems/mount_api.txt | 367 ++++++++-------
Documentation/filesystems/vfs.txt | 4
Makefile | 31 +
arch/ia64/kernel/perfmon.c | 14 -
arch/powerpc/platforms/cell/spufs/inode.c | 207 +++++----
arch/s390/hypfs/inode.c | 137 +++---
drivers/android/binderfs.c | 173 ++++---
drivers/base/devtmpfs.c | 16 -
drivers/block/rbd.c | 363 ++++++++-------
drivers/dax/super.c | 13 -
drivers/gpu/drm/drm_drv.c | 14 -
drivers/infiniband/hw/qib/qib_fs.c | 26 +
drivers/misc/cxl/api.c | 10
drivers/misc/ibmasm/ibmasmfs.c | 21 +
drivers/mtd/mtdcore.h | 1
drivers/mtd/mtdsuper.c | 181 ++++----
drivers/oprofile/oprofilefs.c | 20 +
drivers/scsi/cxlflash/ocxl_hw.c | 21 -
drivers/usb/gadget/function/f_fs.c | 233 +++++-----
drivers/usb/gadget/legacy/inode.c | 21 +
drivers/virtio/virtio_balloon.c | 19 -
drivers/xen/xenfs/super.c | 21 +
fs/aio.c | 15 -
fs/anon_inodes.c | 12
fs/autofs/autofs_i.h | 13 -
fs/autofs/init.c | 9
fs/autofs/inode.c | 429 ++++++++++--------
fs/binfmt_misc.c | 20 +
fs/block_dev.c | 14 -
fs/btrfs/tests/btrfs-tests.c | 13 -
fs/ceph/cache.c | 9
fs/ceph/cache.h | 5
fs/ceph/super.c | 697 ++++++++++++++---------------
fs/ceph/super.h | 1
fs/coda/inode.c | 171 +++++--
fs/configfs/mount.c | 20 +
fs/cramfs/inode.c | 69 ++-
fs/debugfs/inode.c | 186 ++++----
fs/devpts/inode.c | 265 +++++------
fs/efivarfs/super.c | 20 +
fs/fs_context.c | 16 -
fs/fs_parser.c | 18 +
fs/fuse/control.c | 20 +
fs/fuse/inode.c | 291 +++++++-----
fs/gfs2/incore.h | 8
fs/gfs2/ops_fstype.c | 495 ++++++++++++++++-----
fs/gfs2/super.c | 335 --------------
fs/gfs2/super.h | 3
fs/jffs2/fs.c | 21 -
fs/jffs2/os-linux.h | 4
fs/jffs2/super.c | 172 +++----
fs/libfs.c | 91 +++-
fs/nfsd/nfsctl.c | 33 +
fs/nsfs.c | 13 -
fs/openpromfs/inode.c | 20 +
fs/orangefs/orangefs-kernel.h | 8
fs/orangefs/orangefs-mod.c | 3
fs/orangefs/super.c | 186 ++++----
fs/pipe.c | 12
fs/pstore/inode.c | 109 +++--
fs/ramfs/inode.c | 104 +++-
fs/romfs/super.c | 46 +-
fs/squashfs/super.c | 100 ++--
fs/super.c | 301 ++++++-------
fs/tracefs/inode.c | 180 +++----
fs/ubifs/super.c | 447 ++++++++-----------
include/linux/ceph/ceph_debug.h | 1
include/linux/ceph/libceph.h | 17 +
include/linux/fs.h | 24 -
include/linux/fs_context.h | 20 +
include/linux/mtd/super.h | 6
include/linux/ramfs.h | 6
include/linux/shmem_fs.h | 4
init/do_mounts.c | 12
kernel/bpf/inode.c | 92 ++--
mm/shmem.c | 396 +++++++++++-----
mm/zsmalloc.c | 19 -
net/ceph/ceph_common.c | 410 +++++++----------
net/socket.c | 14 -
net/sunrpc/rpc_pipe.c | 34 +
security/apparmor/apparmorfs.c | 20 +
security/inode.c | 21 +
security/selinux/selinuxfs.c | 20 +
security/smack/smackfs.c | 34 +
84 files changed, 4257 insertions(+), 3810 deletions(-)
1 year, 10 months