From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9618AC43331 for ; Thu, 2 Apr 2020 07:14:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 61AB820784 for ; Thu, 2 Apr 2020 07:14:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61AB820784 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 207978E000A; Thu, 2 Apr 2020 03:14:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B75D8E0008; Thu, 2 Apr 2020 03:14:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F4868E000A; Thu, 2 Apr 2020 03:14:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id EC6E08E0008 for ; Thu, 2 Apr 2020 03:14:34 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A373433CD for ; Thu, 2 Apr 2020 07:14:34 +0000 (UTC) X-FDA: 76662052068.20.sleet79_6222f248efc63 X-HE-Tag: sleet79_6222f248efc63 X-Filterd-Recvd-Size: 4875 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 07:14:34 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id a81so2363408wmf.5 for ; Thu, 02 Apr 2020 00:14:34 -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=syw3VZJWmr0VCZnH84syDqZMhiYipx0GVpQcRAjLSd4LkI7clebnttz3WTceO3GpVr lmXBYnD7yM/lA6qs8aEExC0OjG+aRx5AYW5/60dNsvPhl1sue+ZJwdpWuINzMqwQLIts 5GwouX6ZjilK7zIPpgfE9Hy7hrpNRj8+cJlaUKkI10aaQyag8FyZLkGeypkSZYWodD8k x0uqsILgz4xsbI6RB58iPHxSduR5k7ZzMAwtUXA5s6EhtGcNhMREZ6SAu4wzxyxU/3/r E3mX4V8Cg2ZIWNLtlo/HqSKqSZH0Lq5pn/0ieV/cVjdw3h6ACQUSBAbPFbAaXRZDazKr j9pQ== X-Gm-Message-State: AGi0PuaLdEWbmu0aZLKYYPqKU6xDJpIf52d9eDW0ldISEp5GdhkR2Lwg IfOK0i++vfbUmmCPjAspE9A= X-Google-Smtp-Source: APiQypKiVW22lJ+zXwmqgSewMfQ0EZe3P5GLY+hzyfn7cDXQkP9nUkwb6vE+mIG8HHsIvmk4wH3uVw== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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