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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 40867C433B4 for ; Thu, 15 Apr 2021 08:28:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5D43611AC for ; Thu, 15 Apr 2021 08:28:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5D43611AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 669D76B0036; Thu, 15 Apr 2021 04:28:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 640426B006C; Thu, 15 Apr 2021 04:28:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5085D6B0070; Thu, 15 Apr 2021 04:28:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 356A26B0036 for ; Thu, 15 Apr 2021 04:28:28 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E0A468248047 for ; Thu, 15 Apr 2021 08:28:27 +0000 (UTC) X-FDA: 78033924654.14.57C333B Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf06.hostedemail.com (Postfix) with ESMTP id 8227FC0007CB for ; Thu, 15 Apr 2021 08:28:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 266A3B1B0; Thu, 15 Apr 2021 08:28:26 +0000 (UTC) Date: Thu, 15 Apr 2021 10:28:23 +0200 From: Oscar Salvador To: David Hildenbrand Cc: Andrew Morton , Mike Kravetz , Vlastimil Babka , Michal Hocko , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 5/7] mm: Make alloc_contig_range handle free hugetlb pages Message-ID: References: <20210413104747.12177-1-osalvador@suse.de> <20210413104747.12177-6-osalvador@suse.de> <71cce295-91d3-21d8-5075-04a2e828d0f2@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71cce295-91d3-21d8-5075-04a2e828d0f2@redhat.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8227FC0007CB X-Stat-Signature: n6t6wpiurk8cjmdxd7exxeyspqnr96o1 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1618475309-264583 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, Apr 14, 2021 at 02:26:21PM +0200, David Hildenbrand wrote: > > +static inline int isolate_or_dissolve_huge_page(struct page *page) > > +{ > > + return -ENOMEM; > > Without CONFIG_HUGETLB_PAGE, there is no way someone could possible pass in > something valid. Although it doesn't matter too much, -EINVAL or similar > sounds a bit better. I guess we could, was just to make it consistent with the kind of error we return when we have it enabled. > > @@ -809,6 +809,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, > > bool skip_on_failure = false; > > unsigned long next_skip_pfn = 0; > > bool skip_updated = false; > > + bool fatal_error = false; > > Can't we use "ret == -ENOMEM" instead of fatal_error? Yes, we can, I will see how it looks. [...] > > + /* > > + * Fence off gigantic pages as there is a cyclic dependency between > > + * alloc_contig_range and them. Return -ENOME as this has the effect > > s/-ENOME/-ENOMEM/ thanks, I missed that one. > > > + * of bailing out right away without further retrying. > > + */ > > + if (hstate_is_gigantic(h)) > > + return -ENOMEM; > > + > > + return alloc_and_dissolve_huge_page(h, head); > > +} > > + > > struct page *alloc_huge_page(struct vm_area_struct *vma, > > unsigned long addr, int avoid_reserve) > > { > > > > Complicated stuff, but looks good to me. Thanks for having a look! -- Oscar Salvador SUSE L3