2020-05-27 10:07:35

by Joonsoo Kim

[permalink] [raw]
Subject: [PATCH v2 04/12] mm/hugetlb: use provided ac->gfp_mask for allocation

From: Joonsoo Kim <[email protected]>

gfp_mask handling on alloc_huge_page_(node|nodemask) is
slightly changed, from ASSIGN to OR. It's safe since caller of these
functions doesn't pass extra gfp_mask except htlb_alloc_mask().

This is a preparation step for following patches.

Signed-off-by: Joonsoo Kim <[email protected]>
---
mm/hugetlb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 453ba94..dabe460 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1985,7 +1985,7 @@ struct page *alloc_huge_page_node(struct hstate *h,
{
struct page *page = NULL;

- ac->gfp_mask = htlb_alloc_mask(h);
+ ac->gfp_mask |= htlb_alloc_mask(h);
if (ac->nid != NUMA_NO_NODE)
ac->gfp_mask |= __GFP_THISNODE;

@@ -2004,7 +2004,7 @@ struct page *alloc_huge_page_node(struct hstate *h,
struct page *alloc_huge_page_nodemask(struct hstate *h,
struct alloc_control *ac)
{
- ac->gfp_mask = htlb_alloc_mask(h);
+ ac->gfp_mask |= htlb_alloc_mask(h);

spin_lock(&hugetlb_lock);
if (h->free_huge_pages - h->resv_huge_pages > 0) {
--
2.7.4


2020-06-09 13:28:56

by Michal Hocko

[permalink] [raw]
Subject: Re: [PATCH v2 04/12] mm/hugetlb: use provided ac->gfp_mask for allocation

On Wed 27-05-20 15:44:55, Joonsoo Kim wrote:
> From: Joonsoo Kim <[email protected]>
>
> gfp_mask handling on alloc_huge_page_(node|nodemask) is
> slightly changed, from ASSIGN to OR. It's safe since caller of these
> functions doesn't pass extra gfp_mask except htlb_alloc_mask().
>
> This is a preparation step for following patches.

This patch on its own doesn't make much sense to me. Should it be folded
in the patch which uses that?

> Signed-off-by: Joonsoo Kim <[email protected]>
> ---
> mm/hugetlb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 453ba94..dabe460 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1985,7 +1985,7 @@ struct page *alloc_huge_page_node(struct hstate *h,
> {
> struct page *page = NULL;
>
> - ac->gfp_mask = htlb_alloc_mask(h);
> + ac->gfp_mask |= htlb_alloc_mask(h);
> if (ac->nid != NUMA_NO_NODE)
> ac->gfp_mask |= __GFP_THISNODE;
>
> @@ -2004,7 +2004,7 @@ struct page *alloc_huge_page_node(struct hstate *h,
> struct page *alloc_huge_page_nodemask(struct hstate *h,
> struct alloc_control *ac)
> {
> - ac->gfp_mask = htlb_alloc_mask(h);
> + ac->gfp_mask |= htlb_alloc_mask(h);
>
> spin_lock(&hugetlb_lock);
> if (h->free_huge_pages - h->resv_huge_pages > 0) {
> --
> 2.7.4
>

--
Michal Hocko
SUSE Labs

2020-06-10 03:13:17

by Joonsoo Kim

[permalink] [raw]
Subject: Re: [PATCH v2 04/12] mm/hugetlb: use provided ac->gfp_mask for allocation

2020년 6월 9일 (화) 오후 10:26, Michal Hocko <[email protected]>님이 작성:
>
> On Wed 27-05-20 15:44:55, Joonsoo Kim wrote:
> > From: Joonsoo Kim <[email protected]>
> >
> > gfp_mask handling on alloc_huge_page_(node|nodemask) is
> > slightly changed, from ASSIGN to OR. It's safe since caller of these
> > functions doesn't pass extra gfp_mask except htlb_alloc_mask().
> >
> > This is a preparation step for following patches.
>
> This patch on its own doesn't make much sense to me. Should it be folded
> in the patch which uses that?

Splitting this patch is requested by Roman. :)

Anyway, the next version would not have this patch since many thing will be
changed.

Thanks.