Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp8930pxb; Thu, 21 Apr 2022 15:32:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2sggTW1h1VpTDx2Ja4GAKx7YxRTiE/JEGhk0lhnB2xw/0E/zm+U/wZ1DA4MFmASRoWdh5 X-Received: by 2002:a05:6402:26cd:b0:423:b43d:8b09 with SMTP id x13-20020a05640226cd00b00423b43d8b09mr1826773edd.400.1650580366791; Thu, 21 Apr 2022 15:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650580366; cv=none; d=google.com; s=arc-20160816; b=aAD0xvWfcr3B0qADjOviJ2YsCVN+tV0a5LpRX6WskZVkttKLSK0UhAL4isp+lDo6lH mtryMBmC4Ha9Tjw0zZ7TtW0bVRyM3Z+j523yUt7nUkF8c4K3mXQ8qLG8ytFtel+RRd4T uq94FH5O8wlAciYe7DYXZJ5lVPmH5iRyNVKcqhNCpkGo1ZLwtgqK+gVCCZk7gcrctBC6 uFWZYRwkl9wh+717tFUBJDweA2R81HhU3jQvoGGy+jU1tDl1EPjrU31RA68VHkrGCukF s6fY1opKed9Lu7dXqT3p0klGzAWcjLIyVHR1BZg6/HkWmIKFYV0Mjlp5LZ3GfLElULQQ 6bpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=b9b5jBflzggfzAqpilsQ3cgeetEBu+zmZUTEStBQLTg=; b=xDSDEdAlVI1xJLIFYkiHwwBt8vupM1pqSB9cQ1T8HtfcpVT9UKCQxYAmG+4sPmjbMK eiBk+QGL7/A0Xcf0md7a4tBVbO3UR8kB/EnMjGl1dNrq+eWjxxvbh26jZFi1rsZutqAd WygKEIvNAgFrRRS78G5+bQtotcr5UWU71/8HpUWTtNtrRMuPaee1kcC2VXFjRgErYaFt rJ1OLb4qdSqqjnfDkTKNONfhN5E5X6vh/F0oqnThHUnzeVZSaU1rpVCxU9GysY1hBAa+ /1PVoCNl/c/tKSgwzjKsH6mOL5G5vxAiyx/xjnNVRvku1oxFNPIu5dpm1LJNbrGQm47j 7jog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aJVQF93E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020aa7d682000000b0041cd1200204si4214322edr.556.2022.04.21.15.32.22; Thu, 21 Apr 2022 15:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aJVQF93E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384609AbiDUF6j (ORCPT + 99 others); Thu, 21 Apr 2022 01:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384587AbiDUF6i (ORCPT ); Thu, 21 Apr 2022 01:58:38 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 350D06591 for ; Wed, 20 Apr 2022 22:55:49 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id v4so5075490edl.7 for ; Wed, 20 Apr 2022 22:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b9b5jBflzggfzAqpilsQ3cgeetEBu+zmZUTEStBQLTg=; b=aJVQF93EoxUgAr6y80PEHphqgGX/lXqnHarYrsjx2H1pDtSf32ATDs9IspUDQm7j9b mW2JllHJRcsWjDZyLKdMEiYWo0UOYgul/fPhHOyGjZuz4YXgf1s6cxBXngG6CTkZyfar 5p8zDSWMN7hmx4Z8y61hjflCRv3P8+r05YOQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b9b5jBflzggfzAqpilsQ3cgeetEBu+zmZUTEStBQLTg=; b=Mbjvl5T0+PzV8Hrb6NQUybSObOaUGehCnFmcIjhxs/XbsTeF/58sYvToyTtJ67eGai XPmQx/su2Ai8NZDbotU+3KDr9CoSizNrn1V9t3NEdK6YbIuvQ6SBD8aDASKChmdBmyr1 shPpmYMj+Bz1xpAOD7uWskFpT2OCcDGzMIM70ETdfPg3zi6fp6SlKk08nx9diwC6Eo8W je6cGv2WnxJPRl3vrQhEVHEd03QQRFN817WILTguyS96nqcKe3BaUxxoMTI5j0BvvS59 CF58EreYmGQardNnxxAFEsMvjuTM82LCe9oBsG52SBK3VJA023+bmrZGVNL8IChtyu15 u6uQ== X-Gm-Message-State: AOAM531cqKnFzDcaZ+mW3GC+GsEi+P5ZyVJmBHi1bR3FZhmuXhk/WQBN FKszrlpaVrpNUo3cIaSYySBWq1He2otdnRZD5Ig= X-Received: by 2002:a05:6402:3283:b0:423:e141:f3df with SMTP id f3-20020a056402328300b00423e141f3dfmr21438878eda.154.1650520547625; Wed, 20 Apr 2022 22:55:47 -0700 (PDT) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id la10-20020a170907780a00b006e889ee7741sm7435218ejc.75.2022.04.20.22.55.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Apr 2022 22:55:47 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id k23so7815110ejd.3 for ; Wed, 20 Apr 2022 22:55:47 -0700 (PDT) X-Received: by 2002:a2e:8245:0:b0:24b:48b1:a1ab with SMTP id j5-20020a2e8245000000b0024b48b1a1abmr14909260ljh.152.1650520116613; Wed, 20 Apr 2022 22:48:36 -0700 (PDT) MIME-Version: 1.0 References: <20220415164413.2727220-1-song@kernel.org> <4AD023F9-FBCE-4C7C-A049-9292491408AA@fb.com> <88eafc9220d134d72db9eb381114432e71903022.camel@intel.com> <1650511496.iys9nxdueb.astroid@bobo.none> In-Reply-To: <1650511496.iys9nxdueb.astroid@bobo.none> From: Linus Torvalds Date: Wed, 20 Apr 2022 22:48:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 bpf 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP To: Nicholas Piggin Cc: Mike Rapoport , "akpm@linux-foundation.org" , "ast@kernel.org" , "bp@alien8.de" , "bpf@vger.kernel.org" , "daniel@iogearbox.net" , "dborkman@redhat.com" , "edumazet@google.com" , "hch@infradead.org" , "hpa@zytor.com" , "imbrenda@linux.ibm.com" , Kernel Team , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "mbenes@suse.cz" , "mcgrof@kernel.org" , "pmladek@suse.com" , "Edgecombe, Rick P" , "song@kernel.org" , Song Liu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 20, 2022 at 8:25 PM Nicholas Piggin wrote: > > Why not just revert fac54e2bfb5b ? That would be stupid, with no sane way forward. The fact is, HUGE_VMALLOC was badly misdesigned, and enabling it on x86 only ended up showing the problems. It wasn't fac54e2bfb5b that was the fundamental issue. It was the whole "oh, we should never have done it that way to begin with". The whole initial notion that HAVE_ARCH_HUGE_VMALLOC means that there must be no PAGE_SIZE pte assumptions was simply broken. There were actual real cases that had those assumptions, and the whole "let's just change vmalloc behavior by default and then people who don't like it can opt out" was just fundamentally a really bad idea. Power had that random "oh, we don't want to do this for module_alloc", which you had a comment about "more testing" for. And s390 had a case of hardware limitations where it didn't work for some cases. And then enabling it on x86 turned up more issues. So yes, commit fac54e2bfb5b _exposed_ things to a much larger audience. But all it just made clear was that your original notion of "let's change behavior and randomly disable it as things turn up" was just broken. Including "small" details like the fact that apparently VM_FLUSH_RESET_PERMS didn't work correctly any more for this, which caused issues for bpf, and that [PATCH 4/4]. And yes, there was a half-arsed comment ("may require extra work") to that effect in the powerpc __module_alloc() function, but it had been left to others to notice separately. So no. We're not going back to that completely broken model. The lagepage thing needs to be opt-in, and needs a lot more care. Linus