Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp584361pxb; Thu, 15 Apr 2021 01:30:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEsfHf/db2HMgCbsL8YUQxSv1LEOJfS/lbMvAgWj5bYCi15zwWnzBe4MfPBdcwWzdNyQ3u X-Received: by 2002:aa7:928b:0:b029:23e:4d59:1a73 with SMTP id j11-20020aa7928b0000b029023e4d591a73mr2243520pfa.45.1618475443385; Thu, 15 Apr 2021 01:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618475443; cv=none; d=google.com; s=arc-20160816; b=v76J64zq3JdcQ3p1ia50TV4QyjkBEtncyu6zovsWGqC615ZFeL/3MatSbm7trhWoRQ g3F2urnEu+n7aZysHe+Oz9WzNXWL9gu6SM/Yih4Pc/pp9rp+bnGfGXzT7RcNQym8ygIG qOuiRT2eicIG4PM1VgVqqpGEJ6RFHTBabdMl5D0o7XVZswFdSFUXaXqsEhj2FlwftEli a5xNzmDJ57evPPvYTcQVDT73fsYFwz+iAtCSyK4zcm2hImh/+zV6zwtE81ML9dkuRmln PKGMr4E3q1qiBOisG1bgCQeraDn85KvkQyFL+fI/WXJQzdRztoduN7R291U+yD7QDxIA wltA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Dik/cDHdn/DyCVmNwA6yjzz+P39mTeAUga0SoUt2oL4=; b=bGr6j0FCRjPH0v/zEkOpIINkTeu+4Psbq/sW18vNig/Z6Op44LuOUrtUWmF8MNskL4 9DrMlaFscwxsoonIQLufGCKWJv/LKdxylUqCP7HVdB7lrmEpma3DrJbwSwl7r6uHzeHy 9FDgRckCGmP2h6HEqJ1JtYIKH1vqVcBw7P4lhpo10zBGKSliKNvhRGJL5qTRSlMRz3/a QWc5YdOsclJigLni86je6D14LtHe6fi/zZmnwkGDQHNnQQwbyY0OW+NmyiP5VQH833GV nQr3vgX7iHiSQ55lzfuIg9WnRihq0KQCw1MLbmxmv/44UNHs+7exbwibggeTV/FtBf/O ijug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si2367457pgs.390.2021.04.15.01.30.29; Thu, 15 Apr 2021 01:30:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbhDOI2u (ORCPT + 99 others); Thu, 15 Apr 2021 04:28:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:37574 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbhDOI2t (ORCPT ); Thu, 15 Apr 2021 04:28:49 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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