Received: by 10.213.65.68 with SMTP id h4csp132669imn; Tue, 27 Mar 2018 23:57:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/WmyT3VXFnQdb9h8/vBuejmfIUO3Sbz3tYY1iRBoPUk5/x8SNnWyD2XfWUJhk6MfTkU1Ym X-Received: by 10.99.97.20 with SMTP id v20mr1719575pgb.214.1522220253361; Tue, 27 Mar 2018 23:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522220253; cv=none; d=google.com; s=arc-20160816; b=NsSevwD6f2Aw4VfjkKgVBoZ3Hs6NO40aH6g7sbl8MVD8Oc3jRne3SC2SFViS2fnHNW V52wlYxsD1l3Fv3TpT0KeY2gG5/X14Seti9FZ/OQog5mdMq296gglKtOSiMrTQJpxH2i rgqKJjcPryN2DFRyIoDcD0+oLx53I/WbRLrPU2iudRx2RQRd/98oLRWyMwERmOX38BvN 4uSZu9o0aafxJz8BaNm+iz1Omt60Gj58rBoYXHhtM+N8K+t2me8PMaEpHjVfk8sckHP5 VFN+Byzf87LqGi6q+1Zry0zDrqt5dG5/om4Rdit/zyG5N6ar9ShL1O1Xh4vJEiFXAmdi ZOcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=uWfKgPAht80kbf9lI8KjbCDQdDS+ypI+0SsO/gmF4Xk=; b=PBeaMHUc0kW1wtVm/d7Rgavuyj3wH3h4QCQrEnKi6PltF3faUJOHLzy0edQpDGsjMI Z04qCQN0FSKGW7d/ODw6xn3vfXROKI/etQoDl68J+IIax83Sm4yHTeSPlMKX3chgiBhD WWEY0EmGJfK/EmG0HEB2UYLVo126F4P1iSLXLDUgFQ/ANBAKGKi7P+UfNi3Ln/1gl09l XsEnS0/SqDM1kvK6aPHn++YkX1KFYaF7aenXsH9MwbUn4+wHw6Xn3DX7tZD2gG8WIYFF IQhCHeBXs7t5T6jdrka8AdMEDtCpFgucxIZjNZ5n9FSxgwydnhigfynpOqyiqbVXxb/0 y6JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S1dJ2lX7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si3120480pla.612.2018.03.27.23.57.19; Tue, 27 Mar 2018 23:57:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S1dJ2lX7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752875AbeC1Gr1 (ORCPT + 99 others); Wed, 28 Mar 2018 02:47:27 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33203 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752858AbeC1GrW (ORCPT ); Wed, 28 Mar 2018 02:47:22 -0400 Received: by mail-wm0-f66.google.com with SMTP id o23so12619091wmf.0; Tue, 27 Mar 2018 23:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=uWfKgPAht80kbf9lI8KjbCDQdDS+ypI+0SsO/gmF4Xk=; b=S1dJ2lX7FIi+mH1gI/3G4D1EuJ1hctG0x2md2ZzhtLJt3zfaa5YFOEzbVXCrABQIBw wHJiIi6003XnA7i3uxaRXQ2fuV9QNJ3dXPdXINmYaa5p5ZKX/VTFZ2edRs+Pfw1Ttepj 12kfwkrp/T/k74Bh2wus9IH3Bt4mzk8qBy008pRrIkNfa1dYQsea0FFt0Y5vzfjkGMPr tq4cn6KT/IYazYuGiBm5T7bTRWN7qu0QXdh2nlJ309VYS/HgMdotc4wb8admyETP5VkA qk2+8fP/Sm1fw1Id8Aae8jGM5l3kd4TikWOIEqIZEqbUVSCSQBh3pgzzOCzvwgiMyjN4 t9Mg== 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:content-transfer-encoding :in-reply-to:user-agent; bh=uWfKgPAht80kbf9lI8KjbCDQdDS+ypI+0SsO/gmF4Xk=; b=XwI5xHRaiU6+CeGTTUUVdFzI7ma9bhLUvKggd2h7GbhWLy49iPH5SGVnAdoLCPlG8w CSHWHLY8KKejXdeqU/6JqDnbfm7tFPq6s9YKQmscozuwNzPEsbqpq1vWX9r9q6+w+gWi 4fAT5xEYqR07K2LNAAuifQqE+gekX8ZyvWSh6gwDDCqzl275UtlMTcL8uXziiYDYTMMd /xKUAaJ5Xe5urtue7EvKHqjwTvNl7iLhj3W8KrI1r1PoUjfhOyLDsFKGhbmvYRBNqvV5 pnThIbqp/6Db53kSxw1BQkvoy58LUq6Aqu0gXJtEko7De1kpjjfNhpBEY2hx1SmHNed5 DWzg== X-Gm-Message-State: AElRT7G+7e0hR/pmZZb0GMeQLmoeC5016lt8zHvWYDvJrsrtBBpV6A07 Fncbjel+14eeHI4vV8FPEdg= X-Received: by 10.28.217.67 with SMTP id q64mr1547822wmg.12.1522219640931; Tue, 27 Mar 2018 23:47:20 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id z9sm5047247wrz.4.2018.03.27.23.47.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Mar 2018 23:47:19 -0700 (PDT) Date: Tue, 27 Mar 2018 23:47:18 -0700 From: Nathan Chancellor To: "gregkh@linuxfoundation.org" Cc: "Kani, Toshi" , "dan.rue@linaro.org" , "linux-kernel@vger.kernel.org" , "torvalds@linux-foundation.org" , "bp@suse.de" , "tglx@linutronix.de" , "lious.lilei@hisilicon.com" , "guohanjun@huawei.com" , "wxf.wang@hisilicon.com" , "stable@vger.kernel.org" , "akpm@linux-foundation.org" , "hpa@zytor.com" , "will.deacon@arm.com" , "catalin.marinas@arm.com" , "mingo@redhat.com" , "Hocko, Michal" , "cpandya@codeaurora.org" , "willy@infradead.org" Subject: Re: [PATCH 4.4 20/43] mm/vmalloc: add interfaces to free unmapped page table Message-ID: <20180328064718.GA31963@flashbox> References: <20180327162716.407986916@linuxfoundation.org> <20180327162717.580646019@linuxfoundation.org> <20180327201700.xmgzgqox3sz3z32r@xps> <20180327203130.GA18921@localhost> <1522183239.2693.240.camel@hpe.com> <20180327204755.GA19436@localhost> <20180328063202.GB9547@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180328063202.GB9547@kroah.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 28, 2018 at 08:32:02AM +0200, gregkh@linuxfoundation.org wrote: > On Tue, Mar 27, 2018 at 01:47:55PM -0700, Nathan Chancellor wrote: > > On Tue, Mar 27, 2018 at 08:40:56PM +0000, Kani, Toshi wrote: > > > On Tue, 2018-03-27 at 13:31 -0700, Nathan Chancellor wrote: > > > > On Tue, Mar 27, 2018 at 03:17:00PM -0500, Dan Rue wrote: > > > > > On Tue, Mar 27, 2018 at 06:27:24PM +0200, Greg Kroah-Hartman wrote: > > > > > > 4.4-stable review patch. If anyone has any objections, please let me know. > > > > > > > > > : > > > > > > > > > > This patch causes the following build error on 4.4 arm64: > > > > > > > > > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=build-arm64 defconfig > > > > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=build-arm64 > > > > > > > > > > CC arch/arm64/mm/mmu.o > > > > > ../arch/arm64/mm/mmu.c:701:5: error: redefinition of ‘pud_free_pmd_page’ > > > > > int pud_free_pmd_page(pud_t *pud) > > > > > ^~~~~~~~~~~~~~~~~ > > > > > In file included from ../arch/arm64/include/asm/pgtable.h:682:0, > > > > > from ../include/linux/mm.h:55, > > > > > from ../include/linux/mman.h:4, > > > > > from ../arch/arm64/mm/mmu.c:25: > > > > > ../include/asm-generic/pgtable.h:777:19: note: previous definition of ‘pud_free_pmd_page’ was here > > > > > static inline int pud_free_pmd_page(pud_t *pud) > > > > > ^~~~~~~~~~~~~~~~~ > > > > > ../arch/arm64/mm/mmu.c:706:5: error: redefinition of ‘pmd_free_pte_page’ > > > > > int pmd_free_pte_page(pmd_t *pmd) > > > > > ^~~~~~~~~~~~~~~~~ > > > > > In file included from ../arch/arm64/include/asm/pgtable.h:682:0, > > > > > from ../include/linux/mm.h:55, > > > > > from ../include/linux/mman.h:4, > > > > > from ../arch/arm64/mm/mmu.c:25: > > > > > ../include/asm-generic/pgtable.h:781:19: note: previous definition of ‘pmd_free_pte_page’ was here > > > > > static inline int pmd_free_pte_page(pmd_t *pmd) > > > > > ^~~~~~~~~~~~~~~~~ > > > > > make[2]: *** [../scripts/Makefile.build:270: arch/arm64/mm/mmu.o] Error 1 > > > > > make[1]: *** [/home/drue/src/linux/4.4-rc/Makefile:969: arch/arm64/mm] Error 2 > > > > > make[1]: Leaving directory '/home/drue/src/linux/4.4-rc/build-arm64' > > > > > make: *** [Makefile:152: sub-make] Error 2 > > > > > > > > > > > > > > > > > > Both of my arm64 devices built fine with this patch... It seems like > > > > the only way to hit that error is if HAVE_ARCH_HUGE_VMAP isn't set, > > > > which seems impossible since it is selected by ARM64... > > > > > > > > Someone smarter than I might have more insight but this patch is > > > > unchanged from upstream so I can only assume that this error would > > > > manifest there as well. > > > > > > It appears that HAVE_ARCH_HUGE_VMAP was introduced in 4.6 on arm64. > > > Hence the problem in 4.4. > > > > > > Thanks, > > > -Toshi > > > > > > > Ah, thanks for the heads up, since I have 324420bf91f6 ("arm64: add > > support for ioremap() block mappings") in my tree due to Linaro's > > backport of it for their Linaro Stable Kernel, which serves as a base > > for most Android kernels. My apologies for not digging deeper and sorry > > for the noise! > > So should I just drop this patch? Unless I am reading the commit message wrong and ignoring the fact that the mainling commit applied cleanly to 4.4.124, it seems like this is still relevant for x86. Toshi suggested dropping the changes to arch/arm64/mm/mmu.c, which won't be a problem for arm64 devices running the stable kernels as they come because they don't have HAVE_ARCH_HUGE_VMAP so they shouldn't be hitting the bug mentioned in the commit message anyways. However, for Android devices which have the mainline commit I mentioned above introducing HAVE_ARCH_HUGE_VMAP, dropping those changes would mean this commit isn't fixing the issue it mentions, which they would be able to hit in theory. I don't know how you want to handle that but a simple suggestion that would not change the end result of the patch for both the stable tree and frankenkernels would be to add a simple #ifdef CONFIG_ARCH_HAVE_HUGE_VMAP around the changes in arch/arm64/mm/mmu.c. I'll let you be the final judge though! Cheers, Nathan