[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201214140337.GD32193@dhcp22.suse.cz>
Date: Mon, 14 Dec 2020 15:03:37 +0100
From: Michal Hocko <mhocko@...e.com>
To: Pavel Tatashin <pasha.tatashin@...een.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, vbabka@...e.cz, david@...hat.com,
osalvador@...e.de, dan.j.williams@...el.com, sashal@...nel.org,
tyhicks@...ux.microsoft.com, iamjoonsoo.kim@....com,
mike.kravetz@...cle.com, rostedt@...dmis.org, mingo@...hat.com,
jgg@...pe.ca, peterz@...radead.org, mgorman@...e.de,
willy@...radead.org, rientjes@...gle.com, jhubbard@...dia.com,
linux-doc@...r.kernel.org
Subject: Re: [PATCH v3 2/6] mm cma: rename PF_MEMALLOC_NOCMA to
PF_MEMALLOC_PIN
On Fri 11-12-20 15:21:36, Pavel Tatashin wrote:
> PF_MEMALLOC_NOCMA is used ot guarantee that the allocator will not return
> pages that might belong to CMA region. This is currently used for long
> term gup to make sure that such pins are not going to be done on any CMA
> pages.
>
> When PF_MEMALLOC_NOCMA has been introduced we haven't realized that it is
> focusing on CMA pages too much and that there is larger class of pages that
> need the same treatment. MOVABLE zone cannot contain any long term pins as
> well so it makes sense to reuse and redefine this flag for that usecase as
> well. Rename the flag to PF_MEMALLOC_PIN which defines an allocation
> context which can only get pages suitable for long-term pins.
>
> Also re-name:
> memalloc_nocma_save()/memalloc_nocma_restore
> to
> memalloc_pin_save()/memalloc_pin_restore()
> and make the new functions common.
>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@...een.com>
> Reviewed-by: John Hubbard <jhubbard@...dia.com>
Acked-by: Michal Hocko <mhocko@...e.com>
with one comment below
[...]
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1576,7 +1576,7 @@ extern struct pid *cad_pid;
> #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
> #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_mask */
> #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */
> -#define PF_MEMALLOC_NOCMA 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */
> +#define PF_MEMALLOC_PIN 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */
This comment is not really helpeful. I would go with
/* Allocation context constrained to zones which allow long term
* pinning.
*/
Something similar would be useful for memalloc_pin* functions as well.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists