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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 7221CC35242 for ; Sat, 15 Feb 2020 01:57:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 360742081E for ; Sat, 15 Feb 2020 01:57:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dMAR4DoA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 360742081E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ACE876B0003; Fri, 14 Feb 2020 20:57:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A7D9D6B0005; Fri, 14 Feb 2020 20:57:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 993256B0006; Fri, 14 Feb 2020 20:57:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 82B346B0003 for ; Fri, 14 Feb 2020 20:57:08 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 15614181AEF1E for ; Sat, 15 Feb 2020 01:57:08 +0000 (UTC) X-FDA: 76490698536.13.rule64_78714ce3a3427 X-HE-Tag: rule64_78714ce3a3427 X-Filterd-Recvd-Size: 5618 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Sat, 15 Feb 2020 01:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=aPLaqzQiC2oJA5/Vp51UZ2aCFqPxWRiK5NqiMLTMznc=; b=dMAR4DoA0Gv7jeXKJeNuYkD3YD 45d0Dh809kj2THRXdsWLabVKvR2DD8YszgGorTQWrG72vcQdBw8yZd/m8RECx4q/A0RxOBd/8pwVR i52tknsKXcF5fB/M9dOtFn96w0BDHzStEPbp8TuI3ufYyrEWPbJClW+LAmHWPK0vIpiM/DfrwWHuD 8jjd5orYMNrdQNs4ANogJmlpR7kisXksF647BebNYCzmrJK9MABjwfnavX9eQB3f2WY0uJrmAkLXh yEXX09xDmSTG+V+kwBDpKqYBEplhhyfQo1X4CuPLs0AQQ3KcIpItLRIGa+ucK5CBRSe5k2yiPiDGx UmVJCs3g==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2mhV-0005yR-Ta; Sat, 15 Feb 2020 01:56:57 +0000 Subject: Re: [PATCH] hugetlb: fix CONFIG_CGROUP_HUGETLB ifdefs From: Randy Dunlap To: Mina Almasry , linux-mm@kvack.org, linux-next@vger.kernel.org, open list Cc: David Rientjes , Greg Thelen , Mike Kravetz , Shakeel Butt , Andrew Morton References: <7ff9e944-1c6c-f7c1-d812-e12817c7a317@oracle.com> <20200214204544.231482-1-almasrymina@google.com> <5237b9bc-2614-0a3a-afa5-5015f30d28bc@infradead.org> Message-ID: Date: Fri, 14 Feb 2020 17:56:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <5237b9bc-2614-0a3a-afa5-5015f30d28bc@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 2/14/20 5:17 PM, Randy Dunlap wrote: > On 2/14/20 1:00 PM, Mina Almasry wrote: >> On Fri, Feb 14, 2020 at 12:46 PM Mina Almasry = wrote: >>> >>> Fixes an #ifdef bug in the patch referred to below that was >>> causing a build error when CONFIG_DEBUG_VM && >>> !CONFIG_CCGROUP_HUGETLB. >=20 > Hi Mina, >=20 > I don't know if this was supposed to fix the 2 build reports that I mad= e, > but this does not apply cleanly to mmotm (and it's a reply email so it'= s > more difficult to apply anyway): >=20 > Applying patch mm-hugetlb-fix-CONFIG_CGROUP_HUGETLB.patch > patching file mm/hugetlb.c > Hunk #1 succeeded at 289 with fuzz 1. > Hunk #2 succeeded at 325 with fuzz 2. > Hunk #3 FAILED at 435. > 1 out of 3 hunks FAILED -- rejects in file mm/hugetlb.c >=20 OK, I applied this patch manually and it does fix most of the reported bu= ild problems. The only one remaining is this: CC mm/migrate.o In file included from ../mm/migrate.c:39:0: ../include/linux/hugetlb_cgroup.h:146:21: warning: =E2=80=98struct file_r= egion=E2=80=99 declared inside parameter list will not be visible outside= of this definition or declaration struct file_region *rg, ^~~~~~~~~~~ ../include/linux/hugetlb_cgroup.h:145:63: warning: =E2=80=98struct resv_m= ap=E2=80=99 declared inside parameter list will not be visible outside of= this definition or declaration static inline void hugetlb_cgroup_uncharge_file_region(struct resv_map *= resv, ^~~~~~~~ ../include/linux/hugetlb_cgroup.h:233:59: warning: =E2=80=98struct resv_m= ap=E2=80=99 declared inside parameter list will not be visible outside of= this definition or declaration static inline void hugetlb_cgroup_uncharge_counter(struct resv_map *resv= , ^~~~~~~~ >=20 >>> Fixes: b5f16a533ce8a ("hugetlb: support file_region coalescing again"= ) >>> Signed-off-by: Mina Almasry >>> Cc: David Rientjes >>> Cc: Greg Thelen >>> Cc: Mike Kravetz >>> Cc: Shakeel Butt >>> Cc: Andrew Morton >>> --- >>> mm/hugetlb.c | 8 +++++--- >>> 1 file changed, 5 insertions(+), 3 deletions(-) >>> >>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >>> index ee6d262fe6ac0..95d34c58981d2 100644 >>> --- a/mm/hugetlb.c >>> +++ b/mm/hugetlb.c >>> @@ -289,7 +289,7 @@ static bool has_same_uncharge_info(struct file_re= gion *rg, >>> #endif >>> } >>> >>> -#ifdef CONFIG_DEBUG_VM >>> +#if defined(CONFIG_DEBUG_VM) && defined(CONFIG_CGROUP_HUGETLB) >>> static void dump_resv_map(struct resv_map *resv) >>> { >>> struct list_head *head =3D &resv->regions; >>> @@ -325,6 +325,10 @@ static void check_coalesce_bug(struct resv_map *= resv) >>> } >>> } >>> } >>> +#else >>> +static void check_coalesce_bug(struct resv_map *resv) >>> +{ >>> +} >>> #endif >>> >>> static void coalesce_file_region(struct resv_map *resv, struct file_= region *rg) >>> @@ -431,9 +435,7 @@ static long add_reservation_in_range(struct resv_= map *resv, long f, long t, >>> } >>> >>> VM_BUG_ON(add < 0); >>> -#ifdef CONFIG_DEBUG_VM >>> check_coalesce_bug(resv); >>> -#endif >>> return add; >>> } >>> >>> -- >>> 2.25.0.265.gbab2e86ba0-goog --=20 ~Randy Reported-by: Randy Dunlap