* [PATCH] powerpc/fadump: sysfs for fadump memory reservation
@ 2019-08-06 3:12 Sourabh Jain
2019-08-06 10:56 ` Mahesh Jagannath Salgaonkar
2019-08-07 3:10 ` Michael Ellerman
0 siblings, 2 replies; 4+ messages in thread
From: Sourabh Jain @ 2019-08-06 3:12 UTC (permalink / raw)
To: mpe; +Cc: mahesh, linuxppc-dev, Sourabh Jain, hbathini
Add a sys interface to allow querying the memory reserved by fadump
for saving the crash dump.
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
Documentation/powerpc/firmware-assisted-dump.rst | 5 +++++
arch/powerpc/kernel/fadump.c | 14 ++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/Documentation/powerpc/firmware-assisted-dump.rst b/Documentation/powerpc/firmware-assisted-dump.rst
index 9ca12830a48e..4a7f6dc556f5 100644
--- a/Documentation/powerpc/firmware-assisted-dump.rst
+++ b/Documentation/powerpc/firmware-assisted-dump.rst
@@ -222,6 +222,11 @@ Here is the list of files under kernel sysfs:
be handled and vmcore will not be captured. This interface can be
easily integrated with kdump service start/stop.
+/sys/kernel/fadump_mem_reserved
+
+ This is used to display the memory reserved by fadump for saving the
+ crash dump.
+
/sys/kernel/fadump_release_mem
This file is available only when fadump is active during
second kernel. This is used to release the reserved memory
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 4eab97292cc2..70d49013ebec 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1514,6 +1514,13 @@ static ssize_t fadump_enabled_show(struct kobject *kobj,
return sprintf(buf, "%d\n", fw_dump.fadump_enabled);
}
+static ssize_t fadump_mem_reserved_show(struct kobject *kobj,
+ struct kobj_attribute *attr,
+ char *buf)
+{
+ return sprintf(buf, "%ld\n", fw_dump.reserve_dump_area_size);
+}
+
static ssize_t fadump_register_show(struct kobject *kobj,
struct kobj_attribute *attr,
char *buf)
@@ -1632,6 +1639,9 @@ static struct kobj_attribute fadump_attr = __ATTR(fadump_enabled,
static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
0644, fadump_register_show,
fadump_register_store);
+static struct kobj_attribute fadump_mem_reserved_attr =
+ __ATTR(fadump_mem_reserved, 0444,
+ fadump_mem_reserved_show, NULL);
DEFINE_SHOW_ATTRIBUTE(fadump_region);
@@ -1663,6 +1673,10 @@ static void fadump_init_files(void)
printk(KERN_ERR "fadump: unable to create sysfs file"
" fadump_release_mem (%d)\n", rc);
}
+ rc = sysfs_create_file(kernel_kobj, &fadump_mem_reserved_attr.attr);
+ if (rc)
+ pr_err("unable to create sysfs file fadump_mem_reserved (%d)\n",
+ rc);
return;
}
--
2.17.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/fadump: sysfs for fadump memory reservation
2019-08-06 3:12 [PATCH] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain
@ 2019-08-06 10:56 ` Mahesh Jagannath Salgaonkar
2019-08-07 3:10 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Mahesh Jagannath Salgaonkar @ 2019-08-06 10:56 UTC (permalink / raw)
To: Sourabh Jain, mpe; +Cc: linuxppc-dev, hbathini
On 8/6/19 8:42 AM, Sourabh Jain wrote:
> Add a sys interface to allow querying the memory reserved by fadump
> for saving the crash dump.
>
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Looks good to me.
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Thanks,
-Mahesh.
> ---
> Documentation/powerpc/firmware-assisted-dump.rst | 5 +++++
> arch/powerpc/kernel/fadump.c | 14 ++++++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/Documentation/powerpc/firmware-assisted-dump.rst b/Documentation/powerpc/firmware-assisted-dump.rst
> index 9ca12830a48e..4a7f6dc556f5 100644
> --- a/Documentation/powerpc/firmware-assisted-dump.rst
> +++ b/Documentation/powerpc/firmware-assisted-dump.rst
> @@ -222,6 +222,11 @@ Here is the list of files under kernel sysfs:
> be handled and vmcore will not be captured. This interface can be
> easily integrated with kdump service start/stop.
>
> +/sys/kernel/fadump_mem_reserved
> +
> + This is used to display the memory reserved by fadump for saving the
> + crash dump.
> +
> /sys/kernel/fadump_release_mem
> This file is available only when fadump is active during
> second kernel. This is used to release the reserved memory
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 4eab97292cc2..70d49013ebec 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -1514,6 +1514,13 @@ static ssize_t fadump_enabled_show(struct kobject *kobj,
> return sprintf(buf, "%d\n", fw_dump.fadump_enabled);
> }
>
> +static ssize_t fadump_mem_reserved_show(struct kobject *kobj,
> + struct kobj_attribute *attr,
> + char *buf)
> +{
> + return sprintf(buf, "%ld\n", fw_dump.reserve_dump_area_size);
> +}
> +
> static ssize_t fadump_register_show(struct kobject *kobj,
> struct kobj_attribute *attr,
> char *buf)
> @@ -1632,6 +1639,9 @@ static struct kobj_attribute fadump_attr = __ATTR(fadump_enabled,
> static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
> 0644, fadump_register_show,
> fadump_register_store);
> +static struct kobj_attribute fadump_mem_reserved_attr =
> + __ATTR(fadump_mem_reserved, 0444,
> + fadump_mem_reserved_show, NULL);
>
> DEFINE_SHOW_ATTRIBUTE(fadump_region);
>
> @@ -1663,6 +1673,10 @@ static void fadump_init_files(void)
> printk(KERN_ERR "fadump: unable to create sysfs file"
> " fadump_release_mem (%d)\n", rc);
> }
> + rc = sysfs_create_file(kernel_kobj, &fadump_mem_reserved_attr.attr);
> + if (rc)
> + pr_err("unable to create sysfs file fadump_mem_reserved (%d)\n",
> + rc);
> return;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/fadump: sysfs for fadump memory reservation
2019-08-06 3:12 [PATCH] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain
2019-08-06 10:56 ` Mahesh Jagannath Salgaonkar
@ 2019-08-07 3:10 ` Michael Ellerman
2019-08-08 5:43 ` Sourabh Jain
1 sibling, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2019-08-07 3:10 UTC (permalink / raw)
To: Sourabh Jain; +Cc: mahesh, linuxppc-dev, Sourabh Jain, hbathini
Sourabh Jain <sourabhjain@linux.ibm.com> writes:
> Add a sys interface to allow querying the memory reserved by fadump
> for saving the crash dump.
>
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> ---
> Documentation/powerpc/firmware-assisted-dump.rst | 5 +++++
> arch/powerpc/kernel/fadump.c | 14 ++++++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/Documentation/powerpc/firmware-assisted-dump.rst b/Documentation/powerpc/firmware-assisted-dump.rst
> index 9ca12830a48e..4a7f6dc556f5 100644
> --- a/Documentation/powerpc/firmware-assisted-dump.rst
> +++ b/Documentation/powerpc/firmware-assisted-dump.rst
> @@ -222,6 +222,11 @@ Here is the list of files under kernel sysfs:
> be handled and vmcore will not be captured. This interface can be
> easily integrated with kdump service start/stop.
>
> +/sys/kernel/fadump_mem_reserved
> +
> + This is used to display the memory reserved by fadump for saving the
> + crash dump.
> +
> /sys/kernel/fadump_release_mem
> This file is available only when fadump is active during
> second kernel. This is used to release the reserved memory
Dumping these in /sys/kernel is pretty gross, but I guess that ship has
sailed.
But please add it to Documentation/ABI, and Cc the appropriate lists/people.
cheers
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 4eab97292cc2..70d49013ebec 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -1514,6 +1514,13 @@ static ssize_t fadump_enabled_show(struct kobject *kobj,
> return sprintf(buf, "%d\n", fw_dump.fadump_enabled);
> }
>
> +static ssize_t fadump_mem_reserved_show(struct kobject *kobj,
> + struct kobj_attribute *attr,
> + char *buf)
> +{
> + return sprintf(buf, "%ld\n", fw_dump.reserve_dump_area_size);
> +}
> +
> static ssize_t fadump_register_show(struct kobject *kobj,
> struct kobj_attribute *attr,
> char *buf)
> @@ -1632,6 +1639,9 @@ static struct kobj_attribute fadump_attr = __ATTR(fadump_enabled,
> static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
> 0644, fadump_register_show,
> fadump_register_store);
> +static struct kobj_attribute fadump_mem_reserved_attr =
> + __ATTR(fadump_mem_reserved, 0444,
> + fadump_mem_reserved_show, NULL);
>
> DEFINE_SHOW_ATTRIBUTE(fadump_region);
>
> @@ -1663,6 +1673,10 @@ static void fadump_init_files(void)
> printk(KERN_ERR "fadump: unable to create sysfs file"
> " fadump_release_mem (%d)\n", rc);
> }
> + rc = sysfs_create_file(kernel_kobj, &fadump_mem_reserved_attr.attr);
> + if (rc)
> + pr_err("unable to create sysfs file fadump_mem_reserved (%d)\n",
> + rc);
> return;
> }
>
> --
> 2.17.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/fadump: sysfs for fadump memory reservation
2019-08-07 3:10 ` Michael Ellerman
@ 2019-08-08 5:43 ` Sourabh Jain
0 siblings, 0 replies; 4+ messages in thread
From: Sourabh Jain @ 2019-08-08 5:43 UTC (permalink / raw)
To: Michael Ellerman; +Cc: mahesh, linuxppc-dev, hbathini
On 8/7/19 8:40 AM, Michael Ellerman wrote:
> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>> Add a sys interface to allow querying the memory reserved by fadump
>> for saving the crash dump.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> ---
>> Documentation/powerpc/firmware-assisted-dump.rst | 5 +++++
>> arch/powerpc/kernel/fadump.c | 14 ++++++++++++++
>> 2 files changed, 19 insertions(+)
>>
>> diff --git a/Documentation/powerpc/firmware-assisted-dump.rst b/Documentation/powerpc/firmware-assisted-dump.rst
>> index 9ca12830a48e..4a7f6dc556f5 100644
>> --- a/Documentation/powerpc/firmware-assisted-dump.rst
>> +++ b/Documentation/powerpc/firmware-assisted-dump.rst
>> @@ -222,6 +222,11 @@ Here is the list of files under kernel sysfs:
>> be handled and vmcore will not be captured. This interface can be
>> easily integrated with kdump service start/stop.
>>
>> +/sys/kernel/fadump_mem_reserved
>> +
>> + This is used to display the memory reserved by fadump for saving the
>> + crash dump.
>> +
>> /sys/kernel/fadump_release_mem
>> This file is available only when fadump is active during
>> second kernel. This is used to release the reserved memory
>
> Dumping these in /sys/kernel is pretty gross, but I guess that ship has
> sailed.
>
> But please add it to Documentation/ABI, and Cc the appropriate lists/people.
Sure, I will write the ABI documentation and will send the next version.
>
> cheers
>
>> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
>> index 4eab97292cc2..70d49013ebec 100644
>> --- a/arch/powerpc/kernel/fadump.c
>> +++ b/arch/powerpc/kernel/fadump.c
>> @@ -1514,6 +1514,13 @@ static ssize_t fadump_enabled_show(struct kobject *kobj,
>> return sprintf(buf, "%d\n", fw_dump.fadump_enabled);
>> }
>>
>> +static ssize_t fadump_mem_reserved_show(struct kobject *kobj,
>> + struct kobj_attribute *attr,
>> + char *buf)
>> +{
>> + return sprintf(buf, "%ld\n", fw_dump.reserve_dump_area_size);
>> +}
>> +
>> static ssize_t fadump_register_show(struct kobject *kobj,
>> struct kobj_attribute *attr,
>> char *buf)
>> @@ -1632,6 +1639,9 @@ static struct kobj_attribute fadump_attr = __ATTR(fadump_enabled,
>> static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
>> 0644, fadump_register_show,
>> fadump_register_store);
>> +static struct kobj_attribute fadump_mem_reserved_attr =
>> + __ATTR(fadump_mem_reserved, 0444,
>> + fadump_mem_reserved_show, NULL);
>>
>> DEFINE_SHOW_ATTRIBUTE(fadump_region);
>>
>> @@ -1663,6 +1673,10 @@ static void fadump_init_files(void)
>> printk(KERN_ERR "fadump: unable to create sysfs file"
>> " fadump_release_mem (%d)\n", rc);
>> }
>> + rc = sysfs_create_file(kernel_kobj, &fadump_mem_reserved_attr.attr);
>> + if (rc)
>> + pr_err("unable to create sysfs file fadump_mem_reserved (%d)\n",
>> + rc);
>> return;
>> }
>>
>> --
>> 2.17.2
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-08 5:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 3:12 [PATCH] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain
2019-08-06 10:56 ` Mahesh Jagannath Salgaonkar
2019-08-07 3:10 ` Michael Ellerman
2019-08-08 5:43 ` Sourabh Jain
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).