[ndctl PATCH] ndctl, inject-smart: add an interface to inject ctrl-temperature
by QI Fuli
This patch is used to add an interface to inject controller temperature.
The ndctl should be supportive of injecting all possible fields.
Although currently controller temperature injection is not supported
by NVDIMMs, this interface can return a failure report to users.
Signed-off-by: QI Fuli <qi.fuli(a)jp.fujitsu.com>
---
ndctl/inject-smart.c | 1 +
ndctl/lib/libndctl.sym | 1 +
ndctl/lib/private.h | 1 +
ndctl/lib/smart.c | 1 +
ndctl/libndctl.h | 2 ++
5 files changed, 6 insertions(+)
diff --git a/ndctl/inject-smart.c b/ndctl/inject-smart.c
index f5a3a6f..56c39ab 100644
--- a/ndctl/inject-smart.c
+++ b/ndctl/inject-smart.c
@@ -392,6 +392,7 @@ static int smart_inject(struct ndctl_dimm *dimm)
int rc = -EOPNOTSUPP;
send_inject_val(media_temperature)
+ send_inject_val(ctrl_temperature)
send_inject_val(spares)
send_inject_bool(fatal)
send_inject_bool(unsafe_shutdown)
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 9b36960..fae24f0 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -375,4 +375,5 @@ global:
ndctl_dimm_get_flags;
ndctl_dimm_get_event_flags;
ndctl_dimm_is_flag_supported;
+ ndctl_cmd_smart_inject_ctrl_temperature;
} LIBNDCTL_16;
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index a94f894..5ddc682 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -308,6 +308,7 @@ struct ndctl_dimm_ops {
int (*smart_threshold_set_spares)(struct ndctl_cmd *, unsigned int);
struct ndctl_cmd *(*new_smart_inject)(struct ndctl_dimm *);
int (*smart_inject_media_temperature)(struct ndctl_cmd *, bool, unsigned int);
+ int (*smart_inject_ctrl_temperature)(struct ndctl_cmd *, bool, unsigned int);
int (*smart_inject_spares)(struct ndctl_cmd *, bool, unsigned int);
int (*smart_inject_fatal)(struct ndctl_cmd *, bool);
int (*smart_inject_unsafe_shutdown)(struct ndctl_cmd *, bool);
diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c
index 7ba46d1..0e180cf 100644
--- a/ndctl/lib/smart.c
+++ b/ndctl/lib/smart.c
@@ -146,6 +146,7 @@ NDCTL_EXPORT int ndctl_cmd_##op(struct ndctl_cmd *cmd, bool enable, unsigned int
}
smart_cmd_inject_val(smart_inject_media_temperature)
+smart_cmd_inject_val(smart_inject_ctrl_temperature)
smart_cmd_inject_val(smart_inject_spares)
#define smart_cmd_inject(op) \
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 6a6bb0d..e60d80b 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -285,6 +285,8 @@ int ndctl_cmd_smart_threshold_set_spares(struct ndctl_cmd *cmd,
struct ndctl_cmd *ndctl_dimm_cmd_new_smart_inject(struct ndctl_dimm *dimm);
int ndctl_cmd_smart_inject_media_temperature(struct ndctl_cmd *cmd, bool enable,
unsigned int mtemp);
+int ndctl_cmd_smart_inject_ctrl_temperature(struct ndctl_cmd *cmd, bool enable,
+ unsigned int ctemp);
int ndctl_cmd_smart_inject_spares(struct ndctl_cmd *cmd, bool enable,
unsigned int spares);
int ndctl_cmd_smart_inject_fatal(struct ndctl_cmd *cmd, bool enable);
--
2.18.0
3 years, 11 months
Love is a Beautiful Thing. I'm looking for this happiness.
by eulaleebp@mail2betty.com
Good day, dear sir.
My name is Sevgi.
I am a woman, who believe in a destiny with a cheerful future for myself and that you could become a part of it.
I do want to be next to a loving man. I wish to find a man that can give me a real hope and love!
Hope you're interested in becoming a part of my adventure and will reply back soon!
If you are interested in getting to know me closer, please write to my personal e-mail - beautysevgi(a)fastmail.com
Your true soul,
Sevgi.
3 years, 11 months
Will you give me love? I hope that yes!
by clifford-hammer@deming.com
Good day, dear sir.
I am a woman, who believe in a destiny with a cheerful future for myself and that you could become a part of it.
I do want to be next to a loving man. I wish to find a man that can give me a real hope and love!
Hope you're interested in becoming a part of my adventure and will reply back soon!
If you are interested in getting to know me closer, please write to my personal e-mail - beautysevgi(a)fastmail.com
Your true soul,
S.V.
3 years, 11 months
I can not imagine my life alone. I need a beloved one.
by reply-yp8iipigaeqoxabusfng@in2.getdrip.com
Good day, dear sir.
My name is Sevgi.
I am a woman, who believe in a destiny with a cheerful future for myself and that you could become a part of it.
I do want to be next to a loving man. I wish to find a man that can give me a real hope and love!
Hope you're interested in becoming a part of my adventure and will reply back soon!
If you are interested in getting to know me closer, please write to my personal e-mail - beautysevgi(a)fastmail.com
Your true soul,
Sevgi.
3 years, 11 months
[PATCH v2] ipc/shm.c add ->pagesize function to shm_vm_ops
by Jane Chu
05ea88608d4e13 ("mm, hugetlbfs: introduce ->pagesize() to
vm_operations_struct") adds a new ->pagesize() function to hugetlb_vm_ops,
intended to cover all hugetlbfs backed files.
With System V shared memory model, if "huge page" is specified,
the "shared memory" is backed by hugetlbfs files, but the mappings
initiated via shmget/shmat have their original vm_ops overwritten
with shm_vm_ops, so we need to add a ->pagesize function to shm_vm_ops.
Otherwise, vma_kernel_pagesize() returns PAGE_SIZE given a hugetlbfs
backed vma, result in below BUG:
fs/hugetlbfs/inode.c
443 if (unlikely(page_mapped(page))) {
444 BUG_ON(truncate_op);
[ 242.268342] hugetlbfs: oracle (4592): Using mlock ulimits for SHM_HUGETLB is deprecated
[ 282.653208] ------------[ cut here ]------------
[ 282.708447] kernel BUG at fs/hugetlbfs/inode.c:444!
[ 282.818957] Modules linked in: nfsv3 rpcsec_gss_krb5 nfsv4 ...
[ 284.025873] CPU: 35 PID: 5583 Comm: oracle_5583_sbt Not tainted 4.14.35-1829.el7uek.x86_64 #2
[ 284.246609] task: ffff9bf0507aaf80 task.stack: ffffa9e625628000
[ 284.317455] RIP: 0010:remove_inode_hugepages+0x3db/0x3e2
....
[ 285.292389] Call Trace:
[ 285.321630] hugetlbfs_evict_inode+0x1e/0x3e
[ 285.372707] evict+0xdb/0x1af
[ 285.408185] iput+0x1a2/0x1f7
[ 285.443661] dentry_unlink_inode+0xc6/0xf0
[ 285.492661] __dentry_kill+0xd8/0x18d
[ 285.536459] dput+0x1b5/0x1ed
[ 285.571939] __fput+0x18b/0x216
[ 285.609495] ____fput+0xe/0x10
[ 285.646030] task_work_run+0x90/0xa7
[ 285.688788] exit_to_usermode_loop+0xdd/0x116
[ 285.740905] do_syscall_64+0x187/0x1ae
[ 285.785740] entry_SYSCALL_64_after_hwframe+0x150/0x0
Link: http://lkml.kernel.org/r/20180727211727.5020-1-jane.chu@oracle.com
Fixes: 05ea88608d4e13 ("mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct")
Signed-off-by: Jane Chu <jane.chu(a)oracle.com>
Suggested-by: Mike Kravetz <mike.kravetz(a)oracle.com>
Reviewed-by: Mike Kravetz <mike.kravetz(a)oracle.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Acked-by: Davidlohr Bueso <dbueso(a)suse.de>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Michal Hocko <mhocko(a)suse.com>
Cc: Jan Kara <jack(a)suse.cz>
Cc: Jérôme Glisse <jglisse(a)redhat.com>
Cc: Davidlohr Bueso <dave(a)stgolabs.net>
Cc: Manfred Spraul <manfred(a)colorfullife.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
---
ipc/shm.c | 12 ++++++++++++
mm/hugetlb.c | 7 +++++++
2 files changed, 19 insertions(+)
diff --git a/ipc/shm.c b/ipc/shm.c
index 051a3e1fb8df..fefa00d310fb 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -427,6 +427,17 @@ static int shm_split(struct vm_area_struct *vma, unsigned long addr)
return 0;
}
+static unsigned long shm_pagesize(struct vm_area_struct *vma)
+{
+ struct file *file = vma->vm_file;
+ struct shm_file_data *sfd = shm_file_data(file);
+
+ if (sfd->vm_ops->pagesize)
+ return sfd->vm_ops->pagesize(vma);
+
+ return PAGE_SIZE;
+}
+
#ifdef CONFIG_NUMA
static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
{
@@ -554,6 +565,7 @@ static const struct vm_operations_struct shm_vm_ops = {
.close = shm_close, /* callback for when the vm-area is released */
.fault = shm_fault,
.split = shm_split,
+ .pagesize = shm_pagesize,
#if defined(CONFIG_NUMA)
.set_policy = shm_set_policy,
.get_policy = shm_get_policy,
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 039ddbc574e9..3103099f64fd 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3167,6 +3167,13 @@ static vm_fault_t hugetlb_vm_op_fault(struct vm_fault *vmf)
return 0;
}
+/*
+ * When a new function is introduced to vm_operations_struct and added
+ * to hugetlb_vm_ops, please consider adding the function to shm_vm_ops.
+ * This is because under System V memory model, mappings created via
+ * shmget/shmat with "huge page" specified are backed by hugetlbfs files,
+ * their original vm_ops are overwritten with shm_vm_ops.
+ */
const struct vm_operations_struct hugetlb_vm_ops = {
.fault = hugetlb_vm_op_fault,
.open = hugetlb_vm_op_open,
--
2.15.GIT
3 years, 11 months
[PATCH] ipc/shm.c add ->pagesize function to shm_vm_ops
by Jane Chu
Commit 05ea88608d4e13 (mm, hugetlbfs: introduce ->pagesize() to
vm_operations_struct) adds a new ->pagesize() function to
hugetlb_vm_ops, intended to cover all hugetlbfs backed files.
With System V shared memory model, if "huge page" is specified,
the "shared memory" is backed by hugetlbfs files, but the mappings
initiated via shmget/shmat have their original vm_ops overwritten
with shm_vm_ops, so we need to add a ->pagesize function to shm_vm_ops.
Otherwise, vma_kernel_pagesize() returns PAGE_SIZE given a hugetlbfs
backed vma, result in below BUG:
fs/hugetlbfs/inode.c
443 if (unlikely(page_mapped(page))) {
444 BUG_ON(truncate_op);
[ 242.268342] hugetlbfs: oracle (4592): Using mlock ulimits for SHM_HUGETLB is deprecated
[ 282.653208] ------------[ cut here ]------------
[ 282.708447] kernel BUG at fs/hugetlbfs/inode.c:444!
[ 282.818957] Modules linked in: nfsv3 rpcsec_gss_krb5 nfsv4 ...
[ 284.025873] CPU: 35 PID: 5583 Comm: oracle_5583_sbt Not tainted 4.14.35-1829.el7uek.x86_64 #2
[ 284.246609] task: ffff9bf0507aaf80 task.stack: ffffa9e625628000
[ 284.317455] RIP: 0010:remove_inode_hugepages+0x3db/0x3e2
....
[ 285.292389] Call Trace:
[ 285.321630] hugetlbfs_evict_inode+0x1e/0x3e
[ 285.372707] evict+0xdb/0x1af
[ 285.408185] iput+0x1a2/0x1f7
[ 285.443661] dentry_unlink_inode+0xc6/0xf0
[ 285.492661] __dentry_kill+0xd8/0x18d
[ 285.536459] dput+0x1b5/0x1ed
[ 285.571939] __fput+0x18b/0x216
[ 285.609495] ____fput+0xe/0x10
[ 285.646030] task_work_run+0x90/0xa7
[ 285.688788] exit_to_usermode_loop+0xdd/0x116
[ 285.740905] do_syscall_64+0x187/0x1ae
[ 285.785740] entry_SYSCALL_64_after_hwframe+0x150/0x0
Suggested-by: Mike Kravetz <mike.kravetz(a)oracle.com>
Signed-off-by: Jane Chu <jane.chu(a)oracle.com>
---
include/linux/mm.h | 7 +++++++
ipc/shm.c | 12 ++++++++++++
2 files changed, 19 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a0fbb9ffe380..0c759379f2d9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -387,6 +387,13 @@ enum page_entry_size {
* These are the virtual MM functions - opening of an area, closing and
* unmapping it (needed to keep files on disk up-to-date etc), pointer
* to the functions called when a no-page or a wp-page exception occurs.
+ *
+ * Note, when a new function is introduced to vm_operations_struct and
+ * added to hugetlb_vm_ops, please consider adding the function to
+ * shm_vm_ops. This is because under System V memory model, though
+ * mappings created via shmget/shmat with "huge page" specified are
+ * backed by hugetlbfs files, their original vm_ops are overwritten with
+ * shm_vm_ops.
*/
struct vm_operations_struct {
void (*open)(struct vm_area_struct * area);
diff --git a/ipc/shm.c b/ipc/shm.c
index 051a3e1fb8df..fefa00d310fb 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -427,6 +427,17 @@ static int shm_split(struct vm_area_struct *vma, unsigned long addr)
return 0;
}
+static unsigned long shm_pagesize(struct vm_area_struct *vma)
+{
+ struct file *file = vma->vm_file;
+ struct shm_file_data *sfd = shm_file_data(file);
+
+ if (sfd->vm_ops->pagesize)
+ return sfd->vm_ops->pagesize(vma);
+
+ return PAGE_SIZE;
+}
+
#ifdef CONFIG_NUMA
static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
{
@@ -554,6 +565,7 @@ static const struct vm_operations_struct shm_vm_ops = {
.close = shm_close, /* callback for when the vm-area is released */
.fault = shm_fault,
.split = shm_split,
+ .pagesize = shm_pagesize,
#if defined(CONFIG_NUMA)
.set_policy = shm_set_policy,
.get_policy = shm_get_policy,
--
2.15.GIT
3 years, 11 months
[ndctl PATCH] ndctl, test/monitor: fix inject-smart field in test_filter_dimmevent
by Vishal Verma
Change the inject-smart field from -s to -m when testing the
dimm-media-temperature event. The -s seems to have been a copy-paste
error.
Cc: QI Fuli <qi.fuli(a)jp.fujitsu.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
test/monitor.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/monitor.sh b/test/monitor.sh
index 1bbfd14..29d4ea1 100755
--- a/test/monitor.sh
+++ b/test/monitor.sh
@@ -152,7 +152,7 @@ test_filter_dimmevent()
inject_value=$($NDCTL list -H -d $monitor_dimms | jq -r .[]."health"."temperature_threshold")
inject_value=$((inject_value + 1))
start_monitor "-d $monitor_dimms -D dimm-media-temperature"
- inject_smart "-s $inject_value"
+ inject_smart "-m $inject_value"
check_result "$monitor_dimms"
stop_monitor
}
--
2.14.4
3 years, 11 months
I'm a princess who's waiting for her prince!
by cufeban@flurred.com
Good day, dear sir.
I am a woman, who believe in a destiny with a cheerful future for myself and that you could become a part of it.
I do want to be next to a loving man. I wish to find a man that can give me a real hope and love!
Hope you're interested in becoming a part of my adventure and will reply back soon!
If you are interested in getting to know me closer, please write to my personal e-mail - beautysevgi(a)fastmail.com
Your true soul,
S.V.
3 years, 11 months
I want to find a prince who is given to me by fate.
by arvy@liguori.it
Good day, dear sir.
My name is Sevgi.
I am a woman, who believe in a destiny with a cheerful future for myself and that you could become a part of it.
I do want to be next to a loving man. I wish to find a man that can give me a real hope and love!
Hope you're interested in becoming a part of my adventure and will reply back soon!
If you are interested in getting to know me closer, please write to my personal e-mail - beautysevgi291988(a)yahoo.com
Your true soul,
Sevgi.
3 years, 11 months
[PATCH v2 0/6] kaddr and pfn can be NULL to ->direct_access()
by Huaisheng Ye
From: Huaisheng Ye <yehs1(a)lenovo.com>
Changes since v1 [1]:
* Involve the previous patches for pfn can be NULL.
* Reword the patch descriptions according to Christian's comment.
* According to Ross's suggestion, replace local pointer dummy_addr
with NULL within md/dm-writecache for direct_access.
[1]: https://lkml.org/lkml/2018/7/24/199
Some functions within fs/dax, dax/super and md/dm-writecache don't
need to get local pointer kaddr or variable pfn from direct_access.
Assigning NULL to kaddr or pfn to ->direct_access() is more
straightforward and simple than offering a useless local pointer or
variable.
So all ->direct_access() need to check the validity of pointer kaddr
and pfn for NULL assignment. If either of them is equal to NULL, that
is to say callers may have no need for kaddr or pfn, so this series of
patch are prepared for allowing them to pass in NULL instead of having
to pass in a local pointer or variable that they then just throw away.
Huaisheng Ye (6):
libnvdimm, pmem: kaddr and pfn can be NULL to ->direct_access()
s390, dcssblk: kaddr and pfn can be NULL to ->direct_access()
tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access()
dax/super: Do not request a pointer kaddr when not required
md/dm-writecache: Don't request pointer dummy_addr when not required
filesystem-dax: Do not request kaddr and pfn when not required
drivers/dax/super.c | 3 +--
drivers/md/dm-writecache.c | 3 +--
drivers/nvdimm/pmem.c | 7 +++++--
drivers/s390/block/dcssblk.c | 8 +++++---
fs/dax.c | 13 ++++---------
tools/testing/nvdimm/pmem-dax.c | 12 ++++++++----
6 files changed, 24 insertions(+), 22 deletions(-)
--
1.8.3.1
3 years, 11 months