* FAILED: patch "[PATCH] x86/platform/UV: Add adjustable set memory block size" failed to apply to 4.14-stable tree
@ 2018-06-28 2:05 gregkh
2018-06-28 14:26 ` Mike Travis
0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2018-06-28 2:05 UTC (permalink / raw)
To: mike.travis, akpm, andrew.banman, dimitri.sivanich, mingo,
peterz, russ.anderson, tglx, torvalds
Cc: stable
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From f642fb5864a6e3645edce6f85ffe7b44d5e9b990 Mon Sep 17 00:00:00 2001
From: "mike.travis@hpe.com" <mike.travis@hpe.com>
Date: Thu, 24 May 2018 15:17:12 -0500
Subject: [PATCH] x86/platform/UV: Add adjustable set memory block size
function
Add a new function to "adjust" the current fixed UV memory block size
of 2GB so it can be changed to a different physical boundary. This is
out of necessity so arch dependent code can accommodate specific BIOS
requirements which can align these new PMEM modules at less than the
default boundaries.
A "set order" type of function was used to insure that the memory block
size will be a power of two value without requiring a validity check.
64GB was chosen as the upper limit for memory block size values to
accommodate upcoming 4PB systems which have 6 more bits of physical
address space (46 becoming 52).
Signed-off-by: Mike Travis <mike.travis@hpe.com>
Reviewed-by: Andrew Banman <andrew.banman@hpe.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <russ.anderson@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dan.j.williams@intel.com
Cc: jgross@suse.com
Cc: kirill.shutemov@linux.intel.com
Cc: mhocko@suse.com
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/lkml/20180524201711.609546602@stormcage.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 0a400606dea0..20d8bf5fbceb 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1350,16 +1350,28 @@ int kern_addr_valid(unsigned long addr)
/* Amount of ram needed to start using large blocks */
#define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30)
+/* Adjustable memory block size */
+static unsigned long set_memory_block_size;
+int __init set_memory_block_size_order(unsigned int order)
+{
+ unsigned long size = 1UL << order;
+
+ if (size > MEM_SIZE_FOR_LARGE_BLOCK || size < MIN_MEMORY_BLOCK_SIZE)
+ return -EINVAL;
+
+ set_memory_block_size = size;
+ return 0;
+}
+
static unsigned long probe_memory_block_size(void)
{
unsigned long boot_mem_end = max_pfn << PAGE_SHIFT;
unsigned long bz;
- /* If this is UV system, always set 2G block size */
- if (is_uv_system()) {
- bz = MAX_BLOCK_SIZE;
+ /* If memory block size has been set, then use it */
+ bz = set_memory_block_size;
+ if (bz)
goto done;
- }
/* Use regular block if RAM is smaller than MEM_SIZE_FOR_LARGE_BLOCK */
if (boot_mem_end < MEM_SIZE_FOR_LARGE_BLOCK) {
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 31ca3e28b0eb..a6ddefc60517 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -38,6 +38,7 @@ struct memory_block {
int arch_get_memory_phys_device(unsigned long start_pfn);
unsigned long memory_block_size_bytes(void);
+int set_memory_block_size_order(unsigned int order);
/* These states are exposed to userspace as text strings in sysfs */
#define MEM_ONLINE (1<<0) /* exposed to userspace */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: FAILED: patch "[PATCH] x86/platform/UV: Add adjustable set memory block size" failed to apply to 4.14-stable tree
2018-06-28 2:05 FAILED: patch "[PATCH] x86/platform/UV: Add adjustable set memory block size" failed to apply to 4.14-stable tree gregkh
@ 2018-06-28 14:26 ` Mike Travis
0 siblings, 0 replies; 2+ messages in thread
From: Mike Travis @ 2018-06-28 14:26 UTC (permalink / raw)
To: gregkh, akpm, andrew.banman, dimitri.sivanich, mingo, peterz,
russ.anderson, tglx, torvalds
Cc: stable
Yes, there has been a bit of code churn in arch/x86/mm/init_64.c around
this area. I will get the modified patches for each of your replies
late next week as soon as I get back.
Thanks,
Mike
On 6/27/2018 7:05 PM, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 4.14-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From f642fb5864a6e3645edce6f85ffe7b44d5e9b990 Mon Sep 17 00:00:00 2001
> From: "mike.travis@hpe.com" <mike.travis@hpe.com>
> Date: Thu, 24 May 2018 15:17:12 -0500
> Subject: [PATCH] x86/platform/UV: Add adjustable set memory block size
> function
>
> Add a new function to "adjust" the current fixed UV memory block size
> of 2GB so it can be changed to a different physical boundary. This is
> out of necessity so arch dependent code can accommodate specific BIOS
> requirements which can align these new PMEM modules at less than the
> default boundaries.
>
> A "set order" type of function was used to insure that the memory block
> size will be a power of two value without requiring a validity check.
> 64GB was chosen as the upper limit for memory block size values to
> accommodate upcoming 4PB systems which have 6 more bits of physical
> address space (46 becoming 52).
>
> Signed-off-by: Mike Travis <mike.travis@hpe.com>
> Reviewed-by: Andrew Banman <andrew.banman@hpe.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Russ Anderson <russ.anderson@hpe.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: dan.j.williams@intel.com
> Cc: jgross@suse.com
> Cc: kirill.shutemov@linux.intel.com
> Cc: mhocko@suse.com
> Cc: stable@vger.kernel.org
> Link: https://lkml.kernel.org/lkml/20180524201711.609546602@stormcage.americas.sgi.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
>
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 0a400606dea0..20d8bf5fbceb 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1350,16 +1350,28 @@ int kern_addr_valid(unsigned long addr)
> /* Amount of ram needed to start using large blocks */
> #define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30)
>
> +/* Adjustable memory block size */
> +static unsigned long set_memory_block_size;
> +int __init set_memory_block_size_order(unsigned int order)
> +{
> + unsigned long size = 1UL << order;
> +
> + if (size > MEM_SIZE_FOR_LARGE_BLOCK || size < MIN_MEMORY_BLOCK_SIZE)
> + return -EINVAL;
> +
> + set_memory_block_size = size;
> + return 0;
> +}
> +
> static unsigned long probe_memory_block_size(void)
> {
> unsigned long boot_mem_end = max_pfn << PAGE_SHIFT;
> unsigned long bz;
>
> - /* If this is UV system, always set 2G block size */
> - if (is_uv_system()) {
> - bz = MAX_BLOCK_SIZE;
> + /* If memory block size has been set, then use it */
> + bz = set_memory_block_size;
> + if (bz)
> goto done;
> - }
>
> /* Use regular block if RAM is smaller than MEM_SIZE_FOR_LARGE_BLOCK */
> if (boot_mem_end < MEM_SIZE_FOR_LARGE_BLOCK) {
> diff --git a/include/linux/memory.h b/include/linux/memory.h
> index 31ca3e28b0eb..a6ddefc60517 100644
> --- a/include/linux/memory.h
> +++ b/include/linux/memory.h
> @@ -38,6 +38,7 @@ struct memory_block {
>
> int arch_get_memory_phys_device(unsigned long start_pfn);
> unsigned long memory_block_size_bytes(void);
> +int set_memory_block_size_order(unsigned int order);
>
> /* These states are exposed to userspace as text strings in sysfs */
> #define MEM_ONLINE (1<<0) /* exposed to userspace */
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-28 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28 2:05 FAILED: patch "[PATCH] x86/platform/UV: Add adjustable set memory block size" failed to apply to 4.14-stable tree gregkh
2018-06-28 14:26 ` Mike Travis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.