(),
gpiochip_is_requested()).
To be on the safe side: duplicate the string with
kstrdup_const() so that if an unaware user passes an address
to a stack-allocated buffer, we won't get the arbitrary label.
Signed-off-by: Muchun Song
---
drivers/gpio/gpiolib.c | 9 +
1 file changed, 9 insertions(+)
diff
ake the
code more readable.
Signed-off-by: Muchun Song
---
kernel/sched/deadline.c | 19 ++-
kernel/sched/rt.c | 24 +++-
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 91e4202b0
Hi Linus,
Thanks for your review.
Linus Walleij 于2018年10月31日周三 下午6:32写道:
>
> Hi Muchun,
>
> thanks for your patch!
>
> On Wed, Oct 24, 2018 at 3:41 PM Muchun Song wrote:
>
> > gpiod_request_commit() copies the pointer to the label
> > passed as an argument o
(), gpiochip_is_requested()).
To be on the safe side: duplicate the string with kstrdup_const()
so that if an unaware user passes an address to a stack-allocated
buffer, we won't get the arbitrary label.
Also fix gpiod_set_consumer_name().
Signed-off-by: Muchun Song
---
drivers/gpio/gpiolib.c| 25
rev, struct rq_flags *rf)
{
/* do something else ... */
put_prev_task(rq, prev);
/* pick next task p */
set_next_task(rq, p);
/* do something else ... */
}
put_prev_task() can match set_next_task(), which can make the
code more readable.
Signed-off-by: Muc
When CONFIG_RT_GROUP_SCHED is not configured, group_rt_rq() will
return NULL. With this patch applied, we also can get the same result.
Because the compiler will help us optimize the code.
So, we can remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio().
Signed-off-by: Muchun Song
(),
gpiochip_is_requested()).
To be on the safe side: duplicate the string with
kstrdup_const() so that if an unaware user passes an address
to a stack-allocated buffer, we won't get the arbitrary label.
Signed-off-by: Muchun Song
---
drivers/gpio/gpiolib.c | 9 +
1 file changed, 9 insertions(+)
diff
d.
Fix the comment in pick_next_task_rt() to avoid confusing.
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 2e2955a8cf8f..a21ea6021929 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
uct rq *rq)
{
BUG_ON(task_current(rq, p));
}
The task_current() will check if task p and rq->curr are equal.
So, we can remove the unnecessary check in push_rt_task().
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/kernel
uct *pick_next_pushable{_dl}_task(struct rq *rq)
{
BUG_ON(task_current(rq, p));
}
The task_current() will check if task p and rq->curr are equal.
So, we can remove the unnecessary check in push_{rt,dl}_task().
Signed-off-by: Muchun Song
---
Changes in v2:
-also remove unnecessary
Hi, Peter
Thanks for your review.
Just update commit message. So there is no difference between them on the code.
Yours,
Muchun Song
Peter Zijlstra 于2018年11月2日周五 上午12:52写道:
>
>
>
> What if anything is the difference with v1 (which I found yesterday and
> have pending testing).
The simple_strtol() function is deprecated, use kstrtoint() instead.
Signed-off-by: Muchun Song
---
drivers/base/dd.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 169412ee4ae8..940abad069c0 100644
--- a/drivers/base/dd.c
Hi Peter,
Thanks for your review.
Peter Zijlstra 于2018年11月8日周四 上午1:31写道:
>
> On Thu, Nov 08, 2018 at 12:15:05AM +0800, Muchun Song wrote:
> > We use a value to represent the priority of the RT task. But a smaller
> > value corresponds to a higher priority. If there are t
Hi Peter,
This is v2 patch. I'm sorry that I forgot to add the
word "v2" to the subject.
Yours,
Muchun Song
readable.
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 54 ---
1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 9aa3287ce301..4808684607b9 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
The variables are local to the source and do not
need to be in global scope, so make them static.
Signed-off-by: Muchun Song
---
kernel/sched/fair.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f622fc858d7a
Hi Peter,
Ingo Molnar 于2018年11月12日周一 下午2:57写道:
>
>
> * Peter Zijlstra wrote:
>
> > I think you only need the less thing, because:
> >
> > static inline bool prio_lower(int a, int b)
> > {
> > return a > b;
> > }
>
> I'd say that should be named rt_prio_lower(), even if it's local to
>
If condition is false in most cases. So, add an unlikely() to the if
condition, so that the optimizer assumes that the condition is false.
Signed-off-by: Muchun Song
---
drivers/base/dd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/dd.c b/drivers/base
readable.
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 57 +--
1 file changed, 35 insertions(+), 22 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 9aa3287ce301..f28157c8212b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched
is enabled or not. That is
rt, dl and irq's load_avg update. So let the update_others_load_avg() do
it.
Signed-off-by: Muchun Song
---
kernel/sched/fair.c | 59 +
1 file changed, 38 insertions(+), 21 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel
The variable capacity_margin local to the source and do not
need to be in global scope, so make it static.
Signed-off-by: Muchun Song
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 340a2d8d49cb
more readable.
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 68 ---
1 file changed, 46 insertions(+), 22 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 9aa3287ce301..adf0f653c963 100644
--- a/kernel/sched/rt.c
+++ b/kernel
11月6日周二 下午10:30写道:
>
> On Tue, Nov 6, 2018 at 2:47 PM Muchun Song wrote:
> >
> > If condition is false in most cases. So, add an unlikely() to the if
> > condition, so that the optimizer assumes that the condition is false.
> >
> > Signed-off-by: Muchun Song
Hi Rafael,
>
> On Tue, Nov 6, 2018 at 3:43 PM Muchun Song wrote:
> >
> > Hi Rafael,
> >
> > If we want the driver core to test driver remove functions, we can
> > enable CONFIG_DEBUG_TEST_DRIVER_REMOVE. This option is
> > just for testing it.
We may dequeue prev's rt_rq in put_prev_task() only when RT
bandwidth is enabled. If RT bandwidth is disabled, it is
unnecessary for us to call update_curr_rt(). So we add a check
there.
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions
Hi John,
Thanks for your review.
John Stultz 于2018年11月20日周二 上午2:16写道:
>
> On Mon, Nov 19, 2018 at 6:10 AM, Muchun Song wrote:
> > The elements of the heads array are a linked list of timer events that
> > expire at the current time. And it can contain up to LVL_DEPTH levels
uct *pick_next_pushable{_dl}_task(struct rq *rq)
{
BUG_ON(task_current(rq, p));
return p;
}
The task_current() will check if task p and rq->curr are equal.
So, we can remove the unnecessary check in push_{rt,dl}_task().
Signed-off-by: Muchun Song
---
kernel/sched/deadline
readable.
Signed-off-by: Muchun Song
---
kernel/sched/rt.c | 57 +--
1 file changed, 35 insertions(+), 22 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 9aa3287ce301..f28157c8212b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched
Hi tglx,
I'm sorry. Thanks for your reminder.
Thomas Gleixner 于2018年11月28日周三 下午11:15写道:
>
> Song,
>
> On Wed, 21 Nov 2018, Thomas Gleixner wrote:
> > On Tue, 20 Nov 2018, Muchun Song wrote:
> > > Follow the current code logic, the timer0 function is called un
is enabled or not. That is
rt, dl and irq's load_avg update. So let the update_others_load_avg() do
it.
Signed-off-by: Muchun Song
---
kernel/sched/fair.c | 59 +
1 file changed, 38 insertions(+), 21 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel
, in the higher-level is called first than the lower-level function.
I think it might be better to call the lower-level timer function first
than the higher-level function. Because the lower-level has the smaller
granularity and delay has less impact on higher-level. So fix it.
Signed-off-by: Muchun Song
an_movable_pages already deals with these races, so removing the check
> is acceptable. Add comment to racy code.
>
> Signed-off-by: Mike Kravetz
Reviewed-by: Muchun Song
Thanks.
> ---
> fs/hugetlbfs/inode.c | 2 +-
> include/linux/hugetlb.h| 5 +++
On Thu, Jan 14, 2021 at 7:52 PM Oscar Salvador wrote:
>
> On Thu, Jan 14, 2021 at 06:54:30PM +0800, Muchun Song wrote:
> > I think this approach may be only suitable for generic huge page only.
> > So we can implement it only for huge page.
> >
> > Hi Oscar,
>
On Thu, Jan 14, 2021 at 9:20 PM Michal Hocko wrote:
>
> On Thu 14-01-21 18:35:13, Muchun Song wrote:
> > There is a race condition between __free_huge_page()
> > and dissolve_free_huge_page().
> >
> > CPU0: CPU1:
> >
> >
On Tue, Jan 12, 2021 at 4:05 PM Oscar Salvador wrote:
>
> On Wed, Jan 06, 2021 at 10:19:22PM +0800, Muchun Song wrote:
> > Every HugeTLB has more than one struct page structure. We __know__ that
> > we only use the first 4(HUGETLB_CGROUP_MIN_ORDER) struct page structures
>
tplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Cc: sta...@vger.kernel.org
---
mm/hugetlb.c | 41 +
1 file changed, 41 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4741d60f8955..1
on CPU0. Meanwhile, we free it to the
buddy allocator on CPU1. Then, we can trigger a BUG_ON on CPU0. Because
it is already freed to the buddy allocator.
Fixes: c8721bbbdd36 ("mm: memory-hotplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mike Krav
CONFIG_DEBUG_VM is enabled. Just remove the
VM_BUG_ON_PAGE.
Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Acked-by: Michal Hocko
Cc: sta...@vger.kernel.org
---
mm/hugetlb.c | 3 +--
1 file changed, 1 inser
for regular pages and this patch does the same for hugetlb
pages. Although the likelyhood of the race is rather small for hugetlb
pages it makes sense the two code paths in sync.
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Acked-by: Yang Shi
Acked-by: Michal Hocko
Reviewed-by: David
n patch #3.
Changelog since v1 -> v2:
- Export set_page_huge_active() in patch #2 to fix.
- Using head[3].mapping to indicate the page is freed in patch #3.
- Flush @free_hpage_work in patch #4.
Muchun Song (5):
mm: migrate: do not migrate HugeTLB page whose refcount is one
mm: hugetlbfs: fix cannot mi
set_page_huge_active, just leave clear_page_huge_active
as static. Because there are no external users.
Fixes: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate())
Signed-off-by: Muchun Song
Acked-by: Michal Hocko
Reviewed-by: Mike Kravetz
Reviewed-by: Oscar Salvador
Cc: sta...@vger.kernel.org
---
fs/hugetlbfs
On Thu, Jan 14, 2021 at 7:27 AM Mike Kravetz wrote:
>
> On 1/13/21 1:20 AM, Oscar Salvador wrote:
> > On Tue, Jan 12, 2021 at 07:33:33PM +0800, Muchun Song wrote:
> >>> It seems a bit odd to only pass "start" for the BUG_ON.
> >>>
On Sat, Jan 16, 2021 at 12:26 PM Matthew Wilcox wrote:
>
> On Fri, Jan 15, 2021 at 04:31:02PM -0800, Mike Kravetz wrote:
> > +++ b/fs/hugetlbfs/inode.c
> > @@ -735,7 +735,7 @@ static long hugetlbfs_fallocate(struct file *file, int
> > mode, loff_t offset,
> >
> >
On Thu, Jan 14, 2021 at 11:38 PM Michal Hocko wrote:
>
> On Thu 14-01-21 21:47:36, Muchun Song wrote:
> > On Thu, Jan 14, 2021 at 9:20 PM Michal Hocko wrote:
> [...]
> > > > @@ -1770,6 +1789,28 @@ int dissolve_free_huge_page(struct page *page)
> > > >
On Sat, Jan 16, 2021 at 5:11 PM Miaohe Lin wrote:
>
> When we reach here with inode = NULL, we should have crashed as inode has
> already been dereferenced via hstate_inode. In order to make BUG_ON(!inode)
> takes effect, we should defer initializing hstate until we really need it.
> Also do this
On Sat, Jan 23, 2021 at 9:00 AM Mike Kravetz wrote:
>
> X-Gm-Spam: 0
> X-Gm-Phishy: 0
>
> On 1/17/21 7:10 AM, Muchun Song wrote:
> > Every HugeTLB has more than one struct page structure. We __know__ that
> > we only use the first 4(HUGETLB_CGROUP_MIN_ORDER) struct p
within
> hugetlb code where we know we are dealing with a hugetlb page.
> Therefore, the check can be eliminated.
>
> Signed-off-by: Mike Kravetz
> Reviewed-by: Oscar Salvador
Reviewed-by: Muchun Song
> ---
> include/linux/hugetlb.h |
On Mon, Jan 25, 2021 at 5:15 PM David Hildenbrand wrote:
>
> On 25.01.21 08:41, Muchun Song wrote:
> > On Mon, Jan 25, 2021 at 2:40 PM Muchun Song
> > wrote:
> >>
> >> On Mon, Jan 25, 2021 at 8:05 AM David Rientjes wrote:
> >>>
&g
On Sun, Jan 17, 2021 at 11:12 PM Muchun Song wrote:
>
> Hi all,
>
> This patch series will free some vmemmap pages(struct page structures)
> associated with each hugetlbpage when preallocated to save memory.
>
> In order to reduce the difficulty of the first version o
On Wed, Jan 20, 2021 at 9:31 AM Mike Kravetz wrote:
>
> Use new hugetlb specific HPageFreed flag to replace the
> PageHugeFreed interfaces.
>
> Signed-off-by: Mike Kravetz
Reviewed-by: Muchun Song
> ---
> include/linux/hugetlb.h | 3 +++
> mm/h
On Wed, Jan 20, 2021 at 9:10 PM Oscar Salvador wrote:
>
> On Wed, Jan 20, 2021 at 08:52:50PM +0800, Muchun Song wrote:
> > Hi Oscar and Mike,
> >
> > Any suggestions about this version? Looking forward to your
> > review. Thanks a lot.
>
> Hi Muchun,
>
>
On Wed, Jan 6, 2021 at 7:22 AM Mike Kravetz wrote:
>
> On 1/4/21 6:55 PM, Muchun Song wrote:
> > On Tue, Jan 5, 2021 at 8:02 AM Mike Kravetz wrote:
> >>
> >> On 1/3/21 10:58 PM, Muchun Song wrote:
> >>> There is a race condition between __free_hug
This patch series aims to fix some bugs and add some improvements.
Changelog since v1 -> v2:
- Export set_page_huge_active() in patch #2 to fix.
- Using head[3].mapping to indicate the page is freed in patch #3.
- Flush @free_hpage_work in patch #4.
Muchun Song (6):
mm: migrate:
When dissolve_free_huge_page() races with __free_huge_page(), we can
do a retry. Because the race window is small.
Signed-off-by: Muchun Song
---
mm/hugetlb.c | 26 +-
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index
: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate())
Signed-off-by: Muchun Song
---
fs/hugetlbfs/inode.c| 3 ++-
include/linux/hugetlb.h | 2 ++
mm/hugetlb.c| 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index b5c109703daa
on CPU0. Meanwhile, we free it to the
buddy allocator on CPU1. Then, we can trigger a BUG_ON on CPU0. Because
it is already freed to the buddy allocator.
Fixes: c8721bbbdd36 ("mm: memory-hotplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mi
CONFIG_DEBUG_VM is enabled. Just remove the
VM_BUG_ON_PAGE.
Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 67
d36 ("mm: memory-hotplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
---
mm/hugetlb.c | 38 ++
1 file changed, 38 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4741d60f8955..8ff138c17129 100644
--- a/mm/hugetlb.c
If the refcount is one when it is migrated, it means that the page
was freed from under us. So we are done and do not need to migrate.
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Acked-by: Yang Shi
---
mm/migrate.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/mm
ysis in the cover letter.
- Use vmemap pmd table lock instead of a hugetlb specific global lock.
Changelog in v1 -> v2:
- Fix do not call dissolve_compound_page in alloc_huge_page_vmemmap().
- Fix some typo and code style problems.
- Remove unused handle_vmemmap_fault().
- Merge some comm
Very similar to VM_WARN_ON_ONCE_PAGE and VM_BUG_ON_PAGE, add
VM_WARN_ON_PAGE macro.
Signed-off-by: Muchun Song
---
include/linux/mmdebug.h | 8
1 file changed, 8 insertions(+)
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 5d0767cb424a..eff5b13a6945 100644
any functional change.
Signed-off-by: Muchun Song
Acked-by: Mike Kravetz
Reviewed-by: Oscar Salvador
Reviewed-by: David Hildenbrand
---
arch/x86/mm/init_64.c | 3 +-
include/linux/bootmem_info.h | 40 +
include/linux/memory_hotplug.h | 27 -
mm/Makefile
When we free a HugeTLB page to the buddy allocator, we should allocate the
vmemmap pages associated with it. We can do that in the __free_hugepage()
before freeing it to buddy.
Signed-off-by: Muchun Song
---
include/linux/mm.h | 2 ++
mm/hugetlb.c | 2 ++
mm/hugetlb_vmemmap.c | 15
, which means the feature is disabled. We will enable it once all
the infrastructure is there.
Signed-off-by: Muchun Song
---
include/linux/bootmem_info.h | 27 +-
include/linux/mm.h | 3 +
mm/Makefile | 1 +
mm/hugetlb.c | 3 +
mm
Because we reuse the first tail vmemmap page frame and remap it
with read-only, we cannot set the PageHWPosion on a tail page.
So we can use the head[4].private to record the real error page
index and set the raw error page PageHWPoison later.
Signed-off-by: Muchun Song
Reviewed-by: Oscar
.
Signed-off-by: Muchun Song
Acked-by: Mike Kravetz
Reviewed-by: Oscar Salvador
---
include/linux/hugetlb.h | 3 +++
mm/hugetlb.c| 1 +
mm/hugetlb_vmemmap.c| 25 +
mm/hugetlb_vmemmap.h| 10 ++
4 files changed, 35 insertions(+), 4 deletions(-)
diff
to indicate that the HugeTLB
page is already freed from hugepage pool but not freed to buddy
allocator yet. When we hit the inflight page, we just need to flush
the work.
Signed-off-by: Muchun Song
---
mm/hugetlb.c | 38 +-
1 file changed, 37 insertions(+), 1
We should flush work when dissolving a HugeTLB page to make sure that
the HugeTLB page is freed to the buddy allocator. Because the caller
of dissolve_free_huge_pages() relies on this guarantee.
Signed-off-by: Muchun Song
Reviewed-by: Oscar Salvador
---
mm/hugetlb.c | 18 +-
1
.
Signed-off-by: Muchun Song
Reviewed-by: Oscar Salvador
---
include/linux/hugetlb.h| 14 ++
include/linux/hugetlb_cgroup.h | 15 +--
mm/hugetlb.c | 25 -
mm/hugetlb_vmemmap.c | 8
4 files changed, 43
GFP_ATOMIC to allocate the vmemmap pages.
The update_hpage_vmemmap_workfn() is where the call to allocate
vmemmmap pages will be inserted.
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
---
mm/hugetlb.c | 74 ++--
mm/hugetlb_vmemmap.c | 12
other code which frees vmemmap, this config option depends on
HAVE_BOOTMEM_INFO_NODE. The routine register_page_bootmem_info() is
used to register bootmem info. Therefore, make sure
register_page_bootmem_info is enabled if HUGETLB_PAGE_FREE_VMEMMAP
is defined.
Signed-off-by: Muchun Song
Reviewed
Add a kernel parameter hugetlb_free_vmemmap to enable the feature of
freeing unused vmemmap pages associated with each hugetlb page on boot.
Signed-off-by: Muchun Song
Reviewed-by: Oscar Salvador
Reviewed-by: Barry Song
---
Documentation/admin-guide/kernel-parameters.txt | 14
We cannot optimize if a "struct page" crosses page boundaries. If
it is true, we can optimize the code with the help of a compiler.
When free_vmemmap_pages_per_hpage() returns zero, most functions are
optimized by the compiler.
Signed-off-by: Muchun Song
---
include/linux/hugetlb.h |
On Thu, Jan 7, 2021 at 12:13 AM Michal Hocko wrote:
>
> On Wed 06-01-21 16:47:34, Muchun Song wrote:
> > If the refcount is one when it is migrated, it means that the page
> > was freed from under us. So we are done and do not need to migrate.
>
> Is this common enou
On Thu, Jan 7, 2021 at 12:35 AM Michal Hocko wrote:
>
> On Wed 06-01-21 16:47:35, Muchun Song wrote:
> > Because we only can isolate a active page via isolate_huge_page()
> > and hugetlbfs_fallocate() forget to mark it as active, we cannot
> > isolate and migrate those pa
On Thu, Jan 7, 2021 at 5:00 AM Mike Kravetz wrote:
>
> On 1/6/21 8:56 AM, Michal Hocko wrote:
> > On Wed 06-01-21 16:47:36, Muchun Song wrote:
> >> There is a race condition between __free_huge_page()
> >> and dissolve_free_huge_page().
> >>
On Thu, Jan 7, 2021 at 1:07 AM Michal Hocko wrote:
>
> On Wed 06-01-21 16:47:37, Muchun Song wrote:
> > When dissolve_free_huge_page() races with __free_huge_page(), we can
> > do a retry. Because the race window is small.
>
> Is this a bug fix or mere optimization. I hav
On Thu, Jan 7, 2021 at 12:56 AM Michal Hocko wrote:
>
> On Wed 06-01-21 16:47:36, Muchun Song wrote:
> > There is a race condition between __free_huge_page()
> > and dissolve_free_huge_page().
> >
> > CPU0: CPU1:
> >
> >
On Thu, Jan 7, 2021 at 4:41 PM Michal Hocko wrote:
>
> On Thu 07-01-21 13:39:38, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 12:56 AM Michal Hocko wrote:
> > >
> > > On Wed 06-01-21 16:47:36, Muchun Song wrote:
> > > > There is
On Thu, Jan 7, 2021 at 4:39 PM Michal Hocko wrote:
>
> On Thu 07-01-21 11:11:41, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 1:07 AM Michal Hocko wrote:
> > >
> > > On Wed 06-01-21 16:47:37, Muchun Song wrote:
> > > > When dissolve_free_huge_pa
On Thu, Jan 7, 2021 at 5:30 PM David Hildenbrand wrote:
>
> On 06.01.21 09:47, Muchun Song wrote:
> > This patch series aims to fix some bugs and add some improvements.
> >
> > Changelog since v1 -> v2:
> > - Export set_page_huge_active() in patch #2 to f
On Thu, Jan 7, 2021 at 6:10 PM David Hildenbrand wrote:
>
> On 07.01.21 10:40, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 5:30 PM David Hildenbrand wrote:
> >>
> >> On 06.01.21 09:47, Muchun Song wrote:
> >>> This patch series aims
On Thu, Jan 7, 2021 at 7:16 PM Michal Hocko wrote:
>
> On Thu 07-01-21 10:52:21, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 12:13 AM Michal Hocko wrote:
> > >
> > > On Wed 06-01-21 16:47:34, Muchun Song wrote:
> > > > If the refcount is one w
On Thu, Jan 7, 2021 at 7:18 PM Michal Hocko wrote:
>
> On Thu 07-01-21 16:53:13, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 4:41 PM Michal Hocko wrote:
> > >
> > > On Thu 07-01-21 13:39:38, Muchun Song wrote:
> > > > On Thu, J
On Thu, Jan 7, 2021 at 8:38 PM Michal Hocko wrote:
>
> On Thu 07-01-21 19:38:00, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 7:18 PM Michal Hocko wrote:
> > >
> > > On Thu 07-01-21 16:53:13, Muchun Song wrote:
> > > > On Thu,
On Thu, Jan 7, 2021 at 10:11 PM Michal Hocko wrote:
>
> On Thu 07-01-21 20:59:33, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 8:38 PM Michal Hocko wrote:
> [...]
> > > Right. Can we simply back off in the dissolving path when ref count is
> > > 0 &
On Fri, Jan 8, 2021 at 9:08 AM Mike Kravetz wrote:
>
> On 1/7/21 7:11 AM, Muchun Song wrote:
> > On Thu, Jan 7, 2021 at 10:11 PM Michal Hocko wrote:
> >>
> >> On Thu 07-01-21 20:59:33, Muchun Song wrote:
> >>> On Thu, Jan 7, 2021 at 8:38 PM Michal Hoc
set_page_huge_active, just leave clear_page_huge_active
as static. Because there are no external users.
Fixes: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate())
Signed-off-by: Muchun Song
Acked-by: Michal Hocko
Reviewed-by: Mike Kravetz
Cc: sta...@vger.kernel.org
---
fs/hugetlbfs/inode.c| 3 ++-
include
for regular pages and this patch does the same for hugetlb
pages. Although the likelyhood of the race is rather small for hugetlb
pages it makes sense the two code paths in sync.
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Acked-by: Yang Shi
Acked-by: Michal Hocko
---
mm/migrate.c | 6
ce v2 -> v3:
- Update commit log.
- Using head[3].private to indicate the page is freed in patch #3.
Changelog since v1 -> v2:
- Export set_page_huge_active() in patch #2 to fix.
- Using head[3].mapping to indicate the page is freed in patch #3.
- Flush @free_hpage_work in pat
tplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Cc: sta...@vger.kernel.org
---
mm/hugetlb.c | 26 ++
1 file changed, 26 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4741d60f8955..4a9011e121
, it is an optimization for increasing the success
rate of dissolving page.
Signed-off-by: Muchun Song
---
mm/hugetlb.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4a9011e12175..898e4ea43e13 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
CONFIG_DEBUG_VM is enabled. Just remove the
VM_BUG_ON_PAGE.
Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Acked-by: Michal Hocko
Cc: sta...@vger.kernel.org
---
mm/hugetlb.c | 3 +--
1 file changed, 1 inser
on CPU0. Meanwhile, we free it to the
buddy allocator on CPU1. Then, we can trigger a BUG_ON on CPU0. Because
it is already freed to the buddy allocator.
Fixes: c8721bbbdd36 ("mm: memory-hotplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mike Krav
On Thu, Jan 14, 2021 at 8:18 AM Mike Kravetz wrote:
>
> On 1/6/21 6:19 AM, Muchun Song wrote:
> > For HugeTLB page, there are more metadata to save in the struct page.
> > But the head struct page cannot meet our needs, so we have to abuse
> > other tail struct pa
On Thu, Jan 14, 2021 at 6:31 AM Mike Kravetz wrote:
>
> On 1/6/21 6:19 AM, Muchun Song wrote:
> > Very similar to VM_WARN_ON_ONCE_PAGE and VM_BUG_ON_PAGE, add
> > VM_WARN_ON_PAGE macro.
> >
> > Signed-off-by: Muchun Song
> > ---
> > include/linux/mmd
t page(s) already in the buddy
allocator.
Fixes: c8721bbbdd36 ("mm: memory-hotplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Cc: sta...@vger.kernel.org
---
mm/hugetlb.c | 39 +++
1 file chan
set_page_huge_active, just leave clear_page_huge_active
as static. Because there are no external users.
Fixes: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate())
Signed-off-by: Muchun Song
Acked-by: Michal Hocko
Reviewed-by: Mike Kravetz
Reviewed-by: Oscar Salvador
Cc: sta...@vger.kernel.org
---
fs/hugetlbfs
on CPU0. Meanwhile, we free it to the
buddy allocator on CPU1. Then, we can trigger a BUG_ON on CPU0. Because
it is already freed to the buddy allocator.
Fixes: c8721bbbdd36 ("mm: memory-hotplug: enable memory hotplug to handle
hugepage")
Signed-off-by: Muchun Song
Reviewed-by: Mike Krav
CONFIG_DEBUG_VM is enabled. Just remove the
VM_BUG_ON_PAGE.
Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()")
Signed-off-by: Muchun Song
Reviewed-by: Mike Kravetz
Acked-by: Michal Hocko
Cc: sta...@vger.kernel.org
---
mm/hugetlb.c | 3 +--
1 file changed, 1 inser
1 - 100 of 1237 matches
Mail list logo