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 23AB5C10F27 for ; Tue, 10 Mar 2020 09:01:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA50820663 for ; Tue, 10 Mar 2020 09:01:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA50820663 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 8DF996B0006; Tue, 10 Mar 2020 05:01:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 868C56B0007; Tue, 10 Mar 2020 05:01:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 730D96B0008; Tue, 10 Mar 2020 05:01:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 53D0A6B0006 for ; Tue, 10 Mar 2020 05:01:24 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1187110F08 for ; Tue, 10 Mar 2020 09:01:24 +0000 (UTC) X-FDA: 76578858888.19.whip18_809b2ef85d746 X-HE-Tag: whip18_809b2ef85d746 X-Filterd-Recvd-Size: 3296 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Mar 2020 09:01:23 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id s14so1073148wrt.8 for ; Tue, 10 Mar 2020 02:01:23 -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=0lnjLD08KOelgi1ONZY2JM84krgFboyE61707ReGdiQ=; b=LmZhT0HBiFhCUUpIy8DOrfJlfmiHOHEP6tD40pxaZT/39Mm8/Jdsand4HRWVwUato/ cmB2gTO1Oy+2z3jK3EZY10mEXV91pWO8tHjFFEHJaSJ0q02lj9DCLO0v6HxvtY+l0nKV BJdOWKmV4FEnHN6x1y0oNU8SZNKgLGmPygKf7L/MVSa29qR8X1pxffmFNly3svLndliJ bb8STi7gyeYuLrUawSvfIvVg00y8ZNO8gj3IYUIpiEMjL2AVzsVxm8iURev7qDlEInBm v07uz7puxO6X7cIAf8hBamL/T/Xe6pe99jGUGNxzV2R6mPJ4I308UPF/vEDuhmiJlrRJ 8z5A== X-Gm-Message-State: ANhLgQ3Mo9QrVK+FnMZYpUQHx83UjdOLKKJKCdmQx84Obgz5CZbvnr9y qHc+Az+jEEBrqLhmJpDJfdI= X-Google-Smtp-Source: ADFU+vsYBdqlkAUoiNtp3XJDMUr1vNLpjSmnhE13RS0l5B22lgyK7xH7ipsSacbulrWQJ36OS94saw== X-Received: by 2002:a5d:4206:: with SMTP id n6mr25308450wrq.119.1583830882554; Tue, 10 Mar 2020 02:01:22 -0700 (PDT) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id a5sm3074004wmb.37.2020.03.10.02.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 02:01:21 -0700 (PDT) Date: Tue, 10 Mar 2020 10:01:21 +0100 From: Michal Hocko To: Roman Gushchin Cc: Andrew Morton , Johannes Weiner , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org, Rik van Riel , Mike Kravetz Subject: Re: [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma Message-ID: <20200310090121.GB8447@dhcp22.suse.cz> References: <20200310002524.2291595-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310002524.2291595-1-guro@fb.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 Mon 09-03-20 17:25:24, Roman Gushchin wrote: [...] > 2) Run-time allocations of gigantic hugepages are performed using the > cma allocator and the dedicated cma area [...] > @@ -1237,6 +1246,23 @@ static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask, > { > unsigned long nr_pages = 1UL << huge_page_order(h); > > + if (IS_ENABLED(CONFIG_CMA) && hugetlb_cma[0]) { > + struct page *page; > + int nid; > + > + for_each_node_mask(nid, *nodemask) { > + if (!hugetlb_cma[nid]) > + break; > + > + page = cma_alloc(hugetlb_cma[nid], nr_pages, > + huge_page_order(h), true); > + if (page) > + return page; > + } > + > + return NULL; Is there any strong reason why the alloaction annot fallback to non-CMA allocator when the cma is depleted? > + } > + > return alloc_contig_pages(nr_pages, gfp_mask, nid, nodemask); > } -- Michal Hocko SUSE Labs