On Mon, Oct 19, 2020 at 11:04:40AM +0200, David Hildenbrand wrote:
>On 18.10.20 05:57, Wei Yang wrote:
>> On Fri, Oct 16, 2020 at 11:18:39AM +0200, David Hildenbrand wrote:
>>> On 16.10.20 06:03, Wei Yang wrote:
>>>> On Mon, Oct 12, 2020 at 02:53:03PM +0200, David
. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Michal Hocko
>Cc: Oscar Salvador
>Cc: Wei Yang
>Cc: Andrew Morton
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
--
Wei Yang
Help you, Help me
On Mon, Oct 19, 2020 at 10:50:39AM +0200, David Hildenbrand wrote:
>On 19.10.20 09:54, Wei Yang wrote:
>> On Mon, Oct 12, 2020 at 02:53:23PM +0200, David Hildenbrand wrote:
>>> Let's add a safe mechanism to unplug memory, avoiding long/endless loops
>>> when trying
mem.bbm_safe_unplug=0
>on the cmdline.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Michal Hocko
>Cc: Oscar Salvador
>Cc: Wei Yang
>Cc: Andrew Morton
>Signed-off-by: David Hildenbrand
>---
> drivers/virtio/virtio_mem.c | 97 ++
n explicitly enabled.
>
>Note2: Without ZONE_MOVABLE, memory unplug will be extremely unreliable
>with bigger block sizes.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Michal Hocko
>Cc: Oscar Salvador
>Cc: Wei Yang
>Cc
es all memory in case
>something goes wrong. It doesn't restore previous online type. Let's do
>that, so we won't overwrite what e.g., user space configured.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Michal Hocko
>Cc: Oscar Salvador
>C
ichael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Michal Hocko
>Cc: Oscar Salvador
>Cc: Wei Yang
>Cc: Andrew Morton
>Signed-off-by: David Hildenbrand
>---
> drivers/virtio/virtio_mem.c | 484 ++--
> 1 file changed, 4
xxx()
if (vm->in_sbm)
return
notify_xxx()
if (vm->in_sbm)
return
This style looks a little better to me.
--
Wei Yang
Help you, Help me
set, while found I can't 'git fetch' this
repo. Is there any other repo I would apply this patch set?
--
Wei Yang
Help you, Help me
On Fri, Oct 16, 2020 at 03:17:06PM +0200, David Hildenbrand wrote:
>On 16.10.20 10:53, Wei Yang wrote:
>> On Mon, Oct 12, 2020 at 02:53:14PM +0200, David Hildenbrand wrote:
>>> Let's rename to "sbs_per_mb" and "sb_size" and move accordingly.
>>>
&
Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 73 +
> 1 file changed, 50 insertions(+), 23 deletions(-)
>
>diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
>index d132bc
eep pages fake offline when onlining memory, they
>
>a) Have a refcount of 1
>b) Have *not* increased the managed page count
>
>2. alloc_contig_range(), if fake offlined. After we fake-offlined pages
>(e.g., patch #12), such pages
>
>a) Have a refcount of 1
>b) Have *not* increased the managed page count (because we manually
>decreased it)
>
Yep, I got the reason now.
>
>--
>Thanks,
>
>David / dhildenb
--
Wei Yang
Help you, Help me
On Sat, Oct 17, 2020 at 09:39:38AM +0200, David Hildenbrand wrote:
>
>> Am 17.10.2020 um 00:38 schrieb Wei Yang :
>>
>> On Fri, Oct 16, 2020 at 12:32:50PM +0200, David Hildenbrand wrote:
>>>>>> Ok, I seems to understand the logic now.
>>>>>&g
On Fri, Oct 16, 2020 at 11:18:39AM +0200, David Hildenbrand wrote:
>On 16.10.20 06:03, Wei Yang wrote:
>> On Mon, Oct 12, 2020 at 02:53:03PM +0200, David Hildenbrand wrote:
>>> Let's trigger from offlining code when we're not allowed to touch online
Here "touch" me
easily at hand.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 19 +++
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
>di
rtial-onlined pages is
(PageOffline && page_count)
And your commit aa218795cb5fd583c94f
mm: Allow to offline unmovable PageOffline() pages via MEM_GOING_OFFLINE
is introduced to handle this case.
That's pretty clear now.
>--
>Thanks,
>
>David / dhildenb
--
Wei Yang
Help you, Help me
ile all of them adjust page's flag.
>> How they hold reference to struct page?
>
>Sorry, I should have given you the right pointer. (similar to my other
>reply)
>
>We hold a reference either via
>
>1. alloc_contig_range()
I am not familiar with this one, need to spend some time to look into.
>2. memmap init code, when not calling generic_online_page().
I may miss some code here. Before online pages, memmaps are allocated in
section_activate(). They are supposed to be zero-ed. (I don't get the exact
code line.) I am not sure when we grab a refcount here.
>
>So these fake-offline pages can never be actually offlined, because we
>no longer have the memory notifier registered to fix that up.
>
>--
>Thanks,
>
>David / dhildenb
--
Wei Yang
Help you, Help me
ichael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Michal Hocko
>Cc: Oscar Salvador
>Cc: Wei Yang
>Cc: Andrew Morton
>Signed-off-by: David Hildenbrand
>---
> drivers/virtio/virtio_mem.c | 484 ++--
> 1 file changed, 4
Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 50 ++---
> 1 file changed, 35 insertions(+), 15 deletions(-)
>
>diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
>index
ankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 107
> 1 file changed, 73 insertions(+), 34 deletions(-)
>
>diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
>index d
On Mon, Oct 12, 2020 at 02:53:16PM +0200, David Hildenbrand wrote:
>Let's move first_mb_id/next_mb_id/last_usable_mb_id accordingly.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
>
,11 @@ static int virtio_mem_init(struct virtio_mem *vm)
>* - Is required for now for alloc_contig_range() to work reliably -
>* it doesn't properly handle smaller granularity on ZONE_NORMAL.
>*/
>- vm->subblock_size = max_t(uint64_t, MAX_ORDER_NR_PAGES,
>-pageblock_nr_pages) * PAGE_SIZE;
>- vm->subblock_size = max_t(uint64_t, vm->device_block_size,
>-vm->subblock_size);
>- vm->nb_sb_per_mb = memory_block_size_bytes() / vm->subblock_size;
>+ vm->sbm.sb_size = max_t(uint64_t, MAX_ORDER_NR_PAGES,
>+ pageblock_nr_pages) * PAGE_SIZE;
>+ vm->sbm.sb_size = max_t(uint64_t, vm->device_block_size,
>+ vm->sbm.sb_size);
>+ vm->sbm.sbs_per_mb = memory_block_size_bytes() / vm->sbm.sb_size;
>
> /* Round up to the next full memory block */
> vm->first_mb_id = virtio_mem_phys_to_mb_id(vm->addr - 1 +
>@@ -1827,7 +1827,7 @@ static int virtio_mem_init(struct virtio_mem *vm)
> dev_info(>vdev->dev, "memory block size: 0x%lx",
>memory_block_size_bytes());
> dev_info(>vdev->dev, "subblock size: 0x%llx",
>- (unsigned long long)vm->subblock_size);
>+ (unsigned long long)vm->sbm.sb_size);
> if (vm->nid != NUMA_NO_NODE && IS_ENABLED(CONFIG_NUMA))
> dev_info(>vdev->dev, "nid: %d", vm->nid);
>
>--
>2.26.2
--
Wei Yang
Help you, Help me
On Mon, Oct 12, 2020 at 02:53:14PM +0200, David Hildenbrand wrote:
>Let's rename to "sbs_per_mb" and "sb_size" and move accordingly.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: We
y: David Hildenbrand
The code is correct, while the naming is a bit long to understand...
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 90 ++---
> 1 file changed, 43 insertions(+), 47 deletions(-)
>
>diff --git a/drivers/virtio/vir
On Mon, Oct 12, 2020 at 02:53:12PM +0200, David Hildenbrand wrote:
>The calculation is already complicated enough, let's limit it to one
>location.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: W
uot;uint8_t"
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 215 ++--
> 1 file changed, 109 insertions(+), 106 deletion
k, you separate the change into two parts.
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 118 +++-
> 1 file changed, 62 insertions(+), 56 deletions(-)
>
>diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
>in
sb);
> if (rc || !nb_sb)
>@@ -1578,11 +1579,12 @@ static int virtio_mem_unplug_pending_mb(struct
>virtio_mem *vm)
> unsigned long mb_id;
> int rc;
>
>- virtio_mem_for_each_mb_state(vm, mb_id, VIRTIO_MEM_MB_STATE_PLUGGED) {
>+ virtio_mem_sbm_for_each_mb(vm, mb_id, VIRTIO_MEM_SBM_MB_PLUGGED) {
> rc = virtio_mem_mb_unplug(vm, mb_id);
> if (rc)
> return rc;
>- virtio_mem_mb_set_state(vm, mb_id, VIRTIO_MEM_MB_STATE_UNUSED);
>+ virtio_mem_sbm_set_mb_state(vm, mb_id,
>+ VIRTIO_MEM_SBM_MB_UNUSED);
> }
>
> return 0;
>@@ -1974,11 +1976,12 @@ static void virtio_mem_remove(struct virtio_device
>*vdev)
>* After we unregistered our callbacks, user space can online partially
>* plugged offline blocks. Make sure to remove them.
>*/
>- virtio_mem_for_each_mb_state(vm, mb_id,
>- VIRTIO_MEM_MB_STATE_OFFLINE_PARTIAL) {
>+ virtio_mem_sbm_for_each_mb(vm, mb_id,
>+ VIRTIO_MEM_SBM_MB_OFFLINE_PARTIAL) {
> rc = virtio_mem_mb_remove(vm, mb_id);
> BUG_ON(rc);
>- virtio_mem_mb_set_state(vm, mb_id, VIRTIO_MEM_MB_STATE_UNUSED);
>+ virtio_mem_sbm_set_mb_state(vm, mb_id,
>+ VIRTIO_MEM_SBM_MB_UNUSED);
> }
> /*
>* After we unregistered our callbacks, user space can no longer
>@@ -2003,7 +2006,7 @@ static void virtio_mem_remove(struct virtio_device *vdev)
> }
>
> /* remove all tracking data - no locking needed */
>- vfree(vm->mb_state);
>+ vfree(vm->sbm.mb_states);
> vfree(vm->sb_bitmap);
>
> /* reset the device and cleanup the queues */
>--
>2.26.2
--
Wei Yang
Help you, Help me
mplement Device Block Mode (DBM).
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 15 +++
> 1 file changed, 15 insertions(+)
>
>di
On Fri, Oct 16, 2020 at 03:15:03PM +0800, Wei Yang wrote:
>On Mon, Oct 12, 2020 at 02:53:07PM +0200, David Hildenbrand wrote:
>>Let's factor out the core pieces and place the implementation next to
>>virtio_mem_fake_offline(). We'll reuse this functionality soon.
>>
>
nr_pages)
>+{
>+ unsigned long i;
>+
>+ /*
>+ * Get the reference we dropped when going offline and subtract the
>+ * unplugged pages from the managed page counters.
>+ */
>+ adjust_managed_page_count(pfn_to_page(pfn), -nr_pages);
>+ for (i = 0; i < nr_pages; i++)
>+ page_ref_inc(pfn_to_page(pfn + i));
>+}
>+
> static void virtio_mem_online_page_cb(struct page *page, unsigned int order)
> {
> const unsigned long addr = page_to_phys(page);
>--
>2.26.2
--
Wei Yang
Help you, Help me
On Mon, Oct 12, 2020 at 02:53:06PM +0200, David Hildenbrand wrote:
>... which now matches virtio_mem_fake_online(). We'll reuse this
>functionality soon.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewe
On Mon, Oct 12, 2020 at 02:53:05PM +0200, David Hildenbrand wrote:
>No harm done, but let's be consistent.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_m
ic int virtio_mem_memory_notifier_cb(struct
>notifier_block *nb,
> break;
> case MEM_OFFLINE:
> virtio_mem_notify_offline(vm, mb_id);
>+
>+ /*
>+ * Trigger the workqueue. Now that we have some offline memory,
>+ * maybe we can handle pending unplug requests.
>+ */
>+ if (!unplug_online)
>+ virtio_mem_retry(vm);
>+
> vm->hotplug_active = false;
> mutex_unlock(>hotplug_mutex);
> break;
>--
>2.26.2
--
Wei Yang
Help you, Help me
page?
>I tried to document that via
>
>"After we unregistered our callbacks, user space can no longer offline
>partially plugged online memory blocks. No need to worry about them."
>
>
>>
>> Thanks in advance, since I may missed some concepts.
>
>(force) driver unloading is a complicated corner case.
>
>Thanks!
>
>--
>Thanks,
>
>David / dhildenb
--
Wei Yang
Help you, Help me
On Thu, Oct 15, 2020 at 10:00:15AM +0200, David Hildenbrand wrote:
>On 15.10.20 06:02, Wei Yang wrote:
>> On Mon, Oct 12, 2020 at 02:52:56PM +0200, David Hildenbrand wrote:
>>> We actually need one byte less (next_mb_id is exclusive, first_mb_id is
>>> inclusive). Simpl
On Mon, Oct 12, 2020 at 02:53:02PM +0200, David Hildenbrand wrote:
>No longer used, let's drop it.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
If above two patches are merged.
Reviewed-by: Wei Yang
>---
&g
_mem_online_page_cb(struct page *page,
>unsigned int order)
>*/
> rcu_read_lock();
> list_for_each_entry_rcu(vm, _mem_devices, next) {
>- if (!virtio_mem_owned_mb(vm, mb_id))
>+ if (!virtio_mem_contains_range(vm, addr, PFN_PHYS(1 << order)))
> continue;
>
> sb_id = virtio_mem_phys_to_sb_id(vm, addr);
>--
>2.26.2
--
Wei Yang
Help you, Help me
ou do virtio_mem_mb_remove() on OFFLINE_PARTIAL memory
block? Since we wait for the workqueue finish its job.
Also, during virtio_mem_remove(), we just handle OFFLINE_PARTIAL memory block.
How about memory block in other states? It is not necessary to remove
ONLINE[_PARTIAL] memroy blocks?
Thanks in advance, since I may missed some concepts.
>--
>2.26.2
--
Wei Yang
Help you, Help me
On Mon, Oct 12, 2020 at 02:52:58PM +0200, David Hildenbrand wrote:
>We can drop rc2, we don't actually need the value.
>
>Cc: "Michael S. Tsirkin"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
--
Wei Yang
Help you, Help me
"
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
--
Wei Yang
Help you, Help me
igned long new_bytes = vm->next_mb_id - vm->first_mb_id + 2;
>+ unsigned long old_bytes = vm->next_mb_id - vm->first_mb_id;
>+ unsigned long new_bytes = old_bytes + 1;
This is correct.
So this looks more like a fix?
> int old_pages = PFN_UP(old_bytes);
> i
y: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 28 +++-
> 1 file changed, 11 insertions(+), 17 deletions(-)
>
>diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
>index ba4de598f663..a1f5bf7a571a
elease_mem_region_adjustable()
>never fail")
>Link: https://github.com/ClangBuiltLinux/linux/issues/1159
>Signed-off-by: Nathan Chancellor
Reviewed-by: Wei Yang
>---
>
>Presumably, this will be squashed but I included a fixes tag
>nonetheless. Apologies if this has already been n
On Tue, Oct 06, 2020 at 10:42:17AM -0400, Steven Rostedt wrote:
>On Mon, 31 Aug 2020 11:11:03 +0800
>Wei Yang wrote:
>
>> Now we have two similar infrastructure to iterate ftrace_page and
>> dyn_ftrace:
>>
>> * do_for_each_ftrace_rec()
>> * f
On Tue, Oct 06, 2020 at 10:36:38AM -0400, Steven Rostedt wrote:
>On Mon, 31 Aug 2020 11:10:59 +0800
>Wei Yang wrote:
>
>> The purpose of the operation is to get ftrace_iterator, which is embedded
>> in file or seq_file for FMODE_WRITE/FMODE_READ respectively. Since we
>
On Tue, Sep 29, 2020 at 12:12:14PM +0200, David Hildenbrand wrote:
>On 29.09.20 11:18, Wei Yang wrote:
>> On Mon, Sep 28, 2020 at 08:21:08PM +0200, David Hildenbrand wrote:
>>> Page isolation doesn't actually touch the pages, it simply isolates
>>> pagebloc
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yang
>Cc: Oscar Salvador
>Cc: Mike Rapoport
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> mm/memory_hotplug.c | 11 ---
> 1 fi
fter a sequence of generic_online_page() calls in the
>relevant callers.
>
>Reviewed-by: Vlastimil Babka
>Reviewed-by: Oscar Salvador
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yang
&
is change results in all pages getting onlined via online_pages() to
>be placed to the tail of the freelist.
>
>Reviewed-by: Oscar Salvador
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yan
larger ranges, and after
>free_contig_range().
>
>Reviewed-by: Alexander Duyck
>Reviewed-by: Oscar Salvador
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yang
>Cc: Oscar Sal
- should
>be good enough for internal purposes.
>
>Reviewed-by: Alexander Duyck
>Reviewed-by: Vlastimil Babka
>Reviewed-by: Oscar Salvador
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei
This step is already done in rebind_subsystems().
Not necessary to do it again.
Signed-off-by: Wei Yang
---
kernel/cgroup/cgroup.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index dd247747ec14..809b13588124 100644
--- a/kernel/cgroup
be placed to the tail of the freelist.
>>
>> Cc: Andrew Morton
>> Cc: Alexander Duyck
>> Cc: Mel Gorman
>> Cc: Michal Hocko
>> Cc: Dave Hansen
>> Cc: Vlastimil Babka
>> Cc: Wei Yang
>> Cc: Oscar Salvador
>> Cc: Mike Rapopo
onlining a bunch of blocks as zone_movable first and only later convert to
>zone_normal in a controlled way when existing normal zone becomes depeted?
>
To be honest, David's approach is easy to understand for me.
And I don't see some negative effect.
>I guess it's an issue that the e.g. 128M block onlines are so disconnected from
>each other it's hard to employ a strategy that works best for e.g. a whole
>bunch
>of GB onlined at once. But I noticed some effort towards new API, so maybe that
>will be solved there too?
>
>> Thanks!
>>
>> David
>>
>>>
>>> I was about to give it a new respin now that thw hwpoison stuff has been
>>> settled.
>>>
>>> [1] https://patchwork.kernel.org/cover/11059175/
>>>
>>
--
Wei Yang
Help you, Help me
It is not necessary to hold the lock of current when setting nodemask of
a new policy.
Signed-off-by: Wei Yang
---
mm/mempolicy.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 906adc58d86f..3fde772ef5ef 100644
--- a/mm/mempolicy.c
No one use this macro anymore.
Also fix code style of policy_node().
Signed-off-by: Wei Yang
---
include/linux/gfp.h | 2 --
mm/mempolicy.c | 3 +--
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 67a0774e080b..e83cc7f5a2fc
On Fri, Sep 18, 2020 at 09:27:23AM +0200, David Hildenbrand wrote:
>On 18.09.20 04:07, Wei Yang wrote:
>> On Wed, Sep 16, 2020 at 08:34:09PM +0200, David Hildenbrand wrote:
>>> __putback_isolated_page() already documents that pages will be placed to
>>> the tail of the
ance triggering undo of isolation (e.g., alloc_contig_range(),
>memory onlining, memory offlining).
>
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yang
>Cc: Oscar Salvador
>Cc: Mike Rapop
while vmemmap on hotplugged memory would tackle some part of the issue,
>there are cases where this approach is better, and there are even benefits
>when combining both.
While everything changes with shuffle.
>
>Thanks!
>
>David
>
>>
>> I was about to give it a new respin now that thw hwpoison stuff has been
>> settled.
>>
>> [1] https://patchwork.kernel.org/cover/11059175/
>>
--
Wei Yang
Help you, Help me
gratetype_isolate() is used in
__offline_pages if my understanding is correct. How does it contribute on
online_pages?
>
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yang
>Cc: Oscar Salvador
>Cc:
isolation
>behavior (which I doubt), we can always make this configurable by the
>instance triggering undo of isolation (e.g., alloc_contig_range(),
>memory onlining, memory offlining).
>
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave
- should
>be good enough for internal purposes.
>
>Cc: Andrew Morton
>Cc: Alexander Duyck
>Cc: Mel Gorman
>Cc: Michal Hocko
>Cc: Dave Hansen
>Cc: Vlastimil Babka
>Cc: Wei Yang
>Cc: Oscar Salvador
>Cc: Mike Rapoport
>Signed-off-by: D
handle the corner case(shift_arg_pages)
properly, let's do the check on *expand* instead of *insert*.
Signed-off-by: Wei Yang
---
mm/mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 829897646a9c..ca31b405fbfa 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@
licable.
>
Looks good to me.
Reviewed-by: Wei Yang
>Suggested-by: Wei Yang
>Cc: Andrew Morton
>Cc: Michal Hocko
>Cc: Dan Williams
>Cc: Jason Gunthorpe
>Cc: Kees Cook
>Cc: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Signed-off-by:
On Tue, Sep 15, 2020 at 11:15:53AM +0200, David Hildenbrand wrote:
>On 15.09.20 11:06, Wei Yang wrote:
>> On Tue, Sep 15, 2020 at 09:35:30AM +0200, David Hildenbrand wrote:
>>>
>>>>> static int __ref try_remove_memory(int nid, u64 start, u64 size)
>>>
or
>
>#define devm_release_mem_region(dev, start, n) \
> __devm_release_region(dev, _resource, (start), (n))
>
What I prefer is remove iomem_resource from the parameter list. Just use is in
the function body.
For the example you listed, __release_region() would have varies of *paren
"
>Cc: Haiyang Zhang
>Cc: Stephen Hemminger
>Cc: Wei Liu
>Cc: Boris Ostrovsky
>Cc: Juergen Gross
>Cc: Stefano Stabellini
>Cc: Roger Pau Monné
>Cc: Julien Grall
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Signed-off-by: David Hild
pluged memory? So we make them all in IORESOURCE_SYSRAM_XXX family?
>
>Cc: Andrew Morton
>Cc: Michal Hocko
>Cc: Dan Williams
>Cc: Jason Gunthorpe
>Cc: Kees Cook
>Cc: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Cc: Eric Biederman
>Cc: Thomas Gle
: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Signed-off-by: David Hildenbrand
>---
> include/linux/ioport.h | 4 ++--
> kernel/resource.c | 49 --
> mm/memory_hotplug.c| 22 +--
&
: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Signed-off-by: David Hildenbrand
>---
> include/linux/ioport.h | 4 ++--
> kernel/resource.c | 49 --
> mm/memory_hotplug.c| 22 +--
&
On Mon, Sep 14, 2020 at 06:55:28PM -0400, Steven Rostedt wrote:
>On Fri, 28 Aug 2020 11:42:57 +0800
>Wei Yang wrote:
>
>> Steven,
>>
>> Would you like to pick this up?
>>
>
>Hmm, patch 1 and 2 have been accepted (different subjects though):
>
>
if it is a file
backed vma, let's just replace *root* with *file* here.
Signed-off-by: Wei Yang
---
mm/mmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 30b155098606..829897646a9c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -823,7 +823,7 @@ int
-off-by: Wei Yang
---
mm/mmap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 1922e6fce9e7..30b155098606 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -895,10 +895,9 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long
start
On Tue, Sep 08, 2020 at 05:31:22PM +0200, Vlastimil Babka wrote:
>On 8/28/20 10:10 AM, Wei Yang wrote:
>> Instead of convert adjust_next between virtual address and page frame
>> number, let's just store the virtual address into adjust_next.
>
>IMHO more precisely/less
this
>past Kirill and Matthew and Johannes: you did so, thank you, and Kirill
>has blessed it, and no one has nacked it, and I have not noticed any
>disadvantage from this change in lock ordering (documented in 23/32),
>so I'm now going to say
>
>Acked-by: Hugh Dickins
&g
set_hugetlb_cgroup_[rsvd] just manipulate page local data, which is not
necessary to be protected by hugetlb_lock.
Let's take this out.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
The page allocated from buddy is not on any list, so just use list_add()
is enough.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 441b7f7c623e
Instead of add allocated file_region one by one to region_cache, we
could use list_splice to merge two list at once.
Also we know the number of entries in the list, increase the number
directly.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 7
Function dequeue_huge_page_node_exact() iterates the free list and
return the first valid free hpage.
Instead of break and check the loop variant, we could return in the loop
directly. This could reduce some redundant check.
Signed-off-by: Wei Yang
[mike.krav...@oracle.com: points out a logic
We are sure to get a valid file_region, otherwise the
VM_BUG_ON(resv->region_cache_count <= 0) at the very beginning would be
triggered.
Let's remove the redundant one.
Signed-off-by: Wei Yang
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 1 -
1 file changed, 1 deletion(-)
diff --gi
to separate them.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 33 +
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a02bf430de6f..441b7f7c623e 100644
--- a/mm/hugetlb.c
+++ b
.
* adjust 2 based on comment from Mike Kravetz
Wei Yang (7):
mm/hugetlb: not necessary to coalesce regions recursively
mm/hugetlb: remove VM_BUG_ON(!nrg) in
get_file_region_entry_from_cache()
mm/hugetlb: use list_splice to merge two list at once
mm/hugetlb: count file_region to be added when
Per my understanding, we keep the regions ordered and would always
coalesce regions properly. So the task to keep this property is just
to coalesce its neighbour.
Let's simplify this.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 6 +-
1
On Mon, Aug 31, 2020 at 04:06:54PM -0700, Mike Kravetz wrote:
>On 8/30/20 7:23 PM, Wei Yang wrote:
>> Function dequeue_huge_page_node_exact() iterates the free list and
>> return the first valid free hpage.
>>
>> Instead of break and check the loop variant, we could ret
The effect here is to get the number of bits, lets use fls() to do
this job.
Signed-off-by: Wei Yang
---
kernel/trace/ftrace.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 12cb535769bc..9021e16fa079 100644
lid seq_file.
Signed-off-by: Wei Yang
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index edc233122598..12cb535769bc 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5558,7 +5558,6 @@ sta
All the three macro are defined to be used for ftrace_rec_count(). This
can be achieved by (flags & FTRACE_REF_MAX) directly.
Since no other places would use those macros, remove them for clarity.
Also it fixes a typo in the comment.
Signed-off-by: Wei Yang
---
include/linux/ftrace.h
the requirement.
The calculation could be simplified by lower one order level when pages
are not power of 2.
Signed-off-by: Wei Yang
---
kernel/trace/ftrace.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9021e16fa079
Now we have two similar infrastructure to iterate ftrace_page and
dyn_ftrace:
* do_for_each_ftrace_rec()
* for_ftrace_rec_iter()
The 2nd one, for_ftrace_rec_iter(), looks more generic, so preserve it
and replace do_for_each_ftrace_rec() with it.
Signed-off-by: Wei Yang
---
kernel/trace
Fix the comment to comply with the code.
Signed-off-by: Wei Yang
---
include/linux/ftrace.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 23c4d6526998..8e1fd97343c6 100644
--- a/include/linux/ftrace.h
+++ b/include
Trivial cleanups relates to ftrace.
Wei Yang (6):
ftrace: define seq_file only for FMODE_READ
ftrace: use fls() to get the bits for dup_hash()
ftrace: simplify the dyn_ftrace->flags macro
ftrace: simplify the calculation of page number for
ftrace_page->records
ftrace: r
to separate them.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 33 +
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a02bf430de6f..441b7f7c623e 100644
--- a/mm/hugetlb.c
+++ b
We are sure to get a valid file_region, otherwise the
VM_BUG_ON(resv->region_cache_count <= 0) at the very beginning would be
triggered.
Let's remove the redundant one.
Signed-off-by: Wei Yang
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 1 -
1 file changed, 1 deletion(-)
diff --gi
Instead of add allocated file_region one by one to region_cache, we
could use list_splice to merge two list at once.
Also we know the number of entries in the list, increase the number
directly.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 7
Following are some cleanup for hugetlb.
Simple test with tools/testing/selftests/vm/map_hugetlb pass.
v3:
* rebase on v5.9-rc2 which adjust the last patch a little
v2:
* drop 5/6/10 since similar patches are merged or under review.
* adjust 2 based on comment from Mike Kravetz
Wei Yang (7
Function dequeue_huge_page_node_exact() iterates the free list and
return the first valid free hpage.
Instead of break and check the loop variant, we could return in the loop
directly. This could reduce some redundant check.
Signed-off-by: Wei Yang
---
mm/hugetlb.c | 20
1
The page allocated from buddy is not on any list, so just use list_add()
is enough.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 441b7f7c623e
set_hugetlb_cgroup_[rsvd] just manipulate page local data, which is not
necessary to be protected by hugetlb_lock.
Let's take this out.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
Per my understanding, we keep the regions ordered and would always
coalesce regions properly. So the task to keep this property is just
to coalesce its neighbour.
Let's simplify this.
Signed-off-by: Wei Yang
Reviewed-by: Baoquan He
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 6 +-
1
1 - 100 of 1219 matches
Mail list logo