linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Fan <fanc.fnst@cn.fujitsu.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org,
	linux-acpi@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de,
	mingo@redhat.com, keescook@chromium.org, bhe@redhat.com,
	arnd@arndb.de, dyoung@redhat.com, dave.jiang@intel.com,
	lv.zheng@intel.com, rjw@rjwysocki.net, yasu.isimatu@gmail.com
Cc: caoj.fnst@cn.fujitsu.com, lizhijian@cn.fujitsu.com
Subject: [POC] Extend "movable_node" to "movable_node=nn@ss" and add the interface in /sys to show the value
Date: Wed, 11 Oct 2017 10:28:28 +0800	[thread overview]
Message-ID: <20171011022827.GD13296@localhost.localdomain> (raw)

Hi all,

Here is a problem:
Here is a machine with several NUMA nodes and some of them are hot-pluggable,
It's not good for kernel to be extracted in the memory region of movable node.
But in current code, I print the address choosen by kaslr and found it may be
placed in movable node sometimes. To solve this problem, it's better to the
memory region choosen by kaslr to immovable node in kaslr.c. But the memory
infomation about if it's hot-pluggable is stored in ACPI SRAT table, which is
parsed after kernel is extracted. So we can't get the detail memory infomation
before extracting kernel.

There are two methods to solve this problem:

1. Get and parse the srat table before kernel extracted, then mark the memory
   region in movable node which should be avoided in kaslr.
   I have send the patch:
   https://www.spinics.net/lists/kernel/msg2595546.html
   But the change is large and then here is the second method.

2. Extend the movable_node to movable_node=nn@ss, in which nn means
   the size of memory in immovable node, and ss means the start position of
   this memory region.
   But it brings another question, it may be a little difficult for a normal
   user to specify the nn and ss. Because it's hard for a user to know the value
   of the memory in immovable node.
   So I wonder if it's good to add a interface in /sys, like:
   # cat /sys/device/system/memory/immovable_node
   nn@ss
   nn@ss
   ...
   to show the two value.
   When srat table is parsed in acpi_parse_memory_affinity, fill the value
   and user can get and use them.

If anyone has a better method, please let me know.
Any comments will be welcome.

Thanks,
Chao Fan

             reply	other threads:[~2017-10-11  2:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  2:28 Chao Fan [this message]
2017-10-11  7:55 ` [POC] Extend "movable_node" to "movable_node=nn@ss" and add the interface in /sys to show the value Baoquan He
2017-10-11  8:23   ` Chao Fan
2017-10-11  8:42     ` Baoquan He
2017-10-11  9:14       ` Chao Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171011022827.GD13296@localhost.localdomain \
    --to=fanc.fnst@cn.fujitsu.com \
    --cc=arnd@arndb.de \
    --cc=bhe@redhat.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=dave.jiang@intel.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=lv.zheng@intel.com \
    --cc=mingo@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yasu.isimatu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).