Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1434374ybb; Thu, 2 Apr 2020 00:15:24 -0700 (PDT) X-Google-Smtp-Source: APiQypLk7f+2m+serMP36paRyJdmG6yqSwdT5tnVHVMdIA28hwtow2OdDJSZe+uONcYFnFdGbIP5 X-Received: by 2002:aca:eb4e:: with SMTP id j75mr1294988oih.18.1585811724388; Thu, 02 Apr 2020 00:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585811724; cv=none; d=google.com; s=arc-20160816; b=icsProhPP8nokSKFftZn87nrofDc9FoXmV5PMytkOtKaeCAcn0qMYt/T1Rb2/Vumuv m6D+6BwJHMtDkqS1YjjoMqRcRmRRlzgoWWqXxtR7m7C8nDniVg2XtkYa6SB6gn+D7m5J gHqOONoVvTLns/3Zx6Udj9RAaM8NvquRUd5ITGJIXJoXBCEXV5yl0uHve1ISDZgp23TE 2yYNixIkMPr3/zJouwNiu8r1daWmMmUSRT/VoD184aa8Dr4E+Gy+zsOFcCcdD/cmACQW G0ZwBUT5xEPchkQEs3ydI6vA3QVhst4N/lQOqBq8SS4Xg5Ax93R1gIzFxEStV95BLIrO h3cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=6zSvzlPFPe5kHJzBH7BwpSL+DKal1qwCEGq/fwhdzrA=; b=w49lslUkrmFHESWex3jdXOo+hxTNZNiMtUk3i2XU9Y3jx4LPpBUZBeEobpk5t9zT8u HRTiMbUVzZO4PWsu4Ewg9HKfo4PrCicuYBzxmSY5BXYqAGHtR2OB7YyLCPkoA3Rl9VIt g2GCwvZsPhOJdvLEGFKeFIFgXF3zGmKfVbP14GrzS5edlS0gZKzvQjBGNPu6NFRZrSvQ MzithyMR+YViCqYdOQhp0EOLMEpphZzMAlC2SMt4W2z6k0WDMR3rIAs0nwJ9dRzIgu4p DEyw+pZgXeqaBcwQH2z4BjUP+Vp3vAleqaV5XbzrmtaOwzbrxoZNaLxfrFyIMyP70zLv Ij4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e18si298833oth.79.2020.04.02.00.15.12; Thu, 02 Apr 2020 00:15:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387431AbgDBHOf (ORCPT + 99 others); Thu, 2 Apr 2020 03:14:35 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36714 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729289AbgDBHOf (ORCPT ); Thu, 2 Apr 2020 03:14:35 -0400 Received: by mail-wm1-f68.google.com with SMTP id d202so2408360wmd.1 for ; Thu, 02 Apr 2020 00:14:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6zSvzlPFPe5kHJzBH7BwpSL+DKal1qwCEGq/fwhdzrA=; b=QJ9PZqGCl0XPyqkdFQpVBXNWRTyYa4HhN5pOyzO7GoVDz/GXoP3ScInMgZ1p24lvit Gsd5iCHyVfOujdCug0OgaZJiwgpdMY8U9i80zMFiNgJHIg7AVd7qcrIoL0PTuxjox2JW T19afUTKzTUFsK0o5bCwAfzRi8179FTGhO+uTpu5iQFyZi1JQVJ99S3W5FdjIBIO/2Jh kP8eY74MtXqwPIt2siF9IA01lIjQUmQvRS4fJy9msQDv/NBwIrt2nRAWZdznjUp8yuul mLGaapanH3WUOc3C4oUQyF7ZagC0YBMCVRwqShAN/qHoAB6WxAtoZWaL7ZG5tPiqZaXV iojw== X-Gm-Message-State: AGi0PubhGqoqYr0a/hODqv0Ufkg+nKWGV6Io6DUeZ7nhkegi4iJXExOL N7HctB27mLz5DpdlaWI+EYo= X-Received: by 2002:a1c:9ad7:: with SMTP id c206mr1976823wme.48.1585811673285; Thu, 02 Apr 2020 00:14:33 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id t6sm5729079wma.30.2020.04.02.00.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 00:14:32 -0700 (PDT) Date: Thu, 2 Apr 2020 09:14:23 +0200 From: Michal Hocko To: Roman Gushchin Cc: Andrew Morton , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org, Rik van Riel , Andreas Schaufler , Mike Kravetz Subject: Re: [PATCH v3] mm: hugetlb: optionally allocate gigantic hugepages using cma Message-ID: <20200402071423.GE22681@dhcp22.suse.cz> References: <20200311220920.2487528-1-guro@fb.com> <20200401192553.7f437f150203a5fa044a1f75@linux-foundation.org> <20200402024406.GA69473@carbon.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402024406.GA69473@carbon.DHCP.thefacebook.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 01-04-20 19:44:06, Roman Gushchin wrote: > On Wed, Apr 01, 2020 at 07:25:53PM -0700, Andrew Morton wrote: > > On Wed, 11 Mar 2020 15:09:20 -0700 Roman Gushchin wrote: > > > > > At large scale rebooting servers in order to allocate gigantic hugepages > > > is quite expensive and complex. At the same time keeping some constant > > > percentage of memory in reserved hugepages even if the workload isn't > > > using it is a big waste: not all workloads can benefit from using 1 GB > > > pages. > > > > > > The following solution can solve the problem: > > > 1) On boot time a dedicated cma area* is reserved. The size is passed > > > as a kernel argument. > > > 2) Run-time allocations of gigantic hugepages are performed using the > > > cma allocator and the dedicated cma area > > > > > > In this case gigantic hugepages can be allocated successfully with a > > > high probability, however the memory isn't completely wasted if nobody > > > is using 1GB hugepages: it can be used for pagecache, anon memory, > > > THPs, etc. > > > > > > * On a multi-node machine a per-node cma area is allocated on each node. > > > Following gigantic hugetlb allocation are using the first available > > > numa node if the mask isn't specified by a user. > > > > > > Usage: > > > 1) configure the kernel to allocate a cma area for hugetlb allocations: > > > pass hugetlb_cma=10G as a kernel argument > > > > > > 2) allocate hugetlb pages as usual, e.g. > > > echo 10 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages > > > > > > If the option isn't enabled or the allocation of the cma area failed, > > > the current behavior of the system is preserved. > > > > > > x86 and arm-64 are covered by this patch, other architectures can be > > > trivially added later. > > > > Lots of review input on v2, but then everyone went quiet ;) > > > > Has everything been addressed? > > I hope so. There is a nice cleanup from Aslan, which can be merged in or > treated as a separate patch. With the follow up patche I didn't have any objections. I would prefer having hugetlb parts folded into the original patch to make the review easier though. Then I can have a look again. If those patches are going to be as they are now then no problem with me. -- Michal Hocko SUSE Labs