Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp843863pxb; Fri, 22 Apr 2022 12:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz23EbluMHJCLUFhqqY3mVU8AflQaLAp6BrtA6mYbbIN7pjWx1JV/swBSfuCL8JbMpFJbp X-Received: by 2002:a62:fb0f:0:b0:4f2:6d3f:5ffb with SMTP id x15-20020a62fb0f000000b004f26d3f5ffbmr6407156pfm.55.1650655428713; Fri, 22 Apr 2022 12:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650655428; cv=none; d=google.com; s=arc-20160816; b=ByKT6vNalFEs5Acr1YrdOTdC48vjFlcP5Ko6eFJglwgYzJEXHOKHeXfNUY2Tp5LqOU m/K7iaRYCLjZZDI/mijAdg+CRomJY8SRhlxNBfpiYMnhudZXOKGyewDyF29zaJ7f6d1E XR/aWnve+Gl96UQ6kflXhrUnSHqIJYwRmimYJjrr1ABZwJlvg0U28++5IXnAPVhAPSbm S2mO6aBSA+5lb1d5+XahELV2+DYMc/Ojjwxa9fkThK8DUucKRcGotGE3DOCobs8I3Xa3 gMQFZlnAnd30Ng9ep/IHXO2J9kjEp4sgOyjURmY7Xf4/n9N872sxZH5H5JNdLBiv7SgJ 1qNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=Pel2dsTDIe3t8VmyT+t+d8FvIgfC1mdCX7nKYG6+pAU=; b=LnjmwMsdOhyRNTW18TXUkmdBTYwnsg7j8V9FgO1945AAUXK5SQ6IxlVJTImfwjI4AD NquLV/9sniGzeVbU2bjOuLYHNSKO4rlqLQXxKKYiBuVZiBbmaZ3oIRotFjETYqox+ENZ aoMYMxiV7kPOiuoh+lbIVU4VP/+T2gbcjLx9hW7exdy5+FxC0MnHGiKzr1RcRXaMMJsn YQFJ5l7G7xGfwil7maG2hs7Qi1ciSFov7I2ZayOwguxxhiJjM2K9DlLHCRrz0Mhm2X7R q8inXaVl5k67v8w9a71YJ3QbnDv9Ty8reBYSES7t+097QsLM7c5NbTi22PiceJqHglF9 PBEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KE+1uE8G; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x36-20020a056a0018a400b004fa3a8dff75si8891062pfh.44.2022.04.22.12.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:23:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KE+1uE8G; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86E291C82DF; Fri, 22 Apr 2022 11:36:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387277AbiDUJKZ (ORCPT + 99 others); Thu, 21 Apr 2022 05:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387266AbiDUJKT (ORCPT ); Thu, 21 Apr 2022 05:10:19 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F4513F82; Thu, 21 Apr 2022 02:07:30 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id q3so4279284plg.3; Thu, 21 Apr 2022 02:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=Pel2dsTDIe3t8VmyT+t+d8FvIgfC1mdCX7nKYG6+pAU=; b=KE+1uE8GspZJXXd4phb9kpKGBFpu+wjtmQuW/trkeZUN7ovwbbuSZOWD1TViv4mTmA fYUHJU53DQ9FrM9JacJLmdewAPaLgaXJEMY7fECM4Snj/d2SIe2lP9IyeGH3uscJp6VN Jn+7Y4QHlP4czVFWdRMjMGIFJjqX93NAXVZVF6QIfQnRMXiJjDTr6BWu9dhXt1i0ztRG XtcrkCd61b/jbbbFzmLB75Ln+jT4PxtRceQhIflESDHg7dzmHadrcNQ5fkJCY9PvqFgj g0bHiIwIN76nDb7ziCfKGdb1naBLE29U4i0Sc6+5wS88eFQlEQqkr3SWBAFc5jlWWNkP DZew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=Pel2dsTDIe3t8VmyT+t+d8FvIgfC1mdCX7nKYG6+pAU=; b=1Ic/HtLhi9212xACKiCZpdFnoL4Hy3B5Df7fF5NqyMpCcOIZvOejehB5AkBzXex9Wg trCkF+3ku/OdmhSM7jtsBhZNUuCSPmVEl7A6VAnWK3z9DNr7OWn0oCyc5IxiBPLrtf1H T+L3juja1Anf9l1SyDtX9z/SImZ1lWWNPVU+1yyTx/5xqaVt9WsgVPKGieJVXYUFZuED ePqkrOwDboMEw9hcoImg85eqksbqbx87rgnulLEUjsU7W2veHPwI9Cbgnwy5A3asaADh r95lNC9C2wKHgv1DejWqUAIbslEcbuk8WAQzq4UNlcyW6266tzNPQprYIHQ79VazIe2E qVJA== X-Gm-Message-State: AOAM530ya3WmRmSrvdrwQHw1yoLTBaBbwJOodELq3FejMwFOyPjGAPZU 8/k2p1nQbAp/jsd+1zsZbRA= X-Received: by 2002:a17:902:bf04:b0:149:c5a5:5323 with SMTP id bi4-20020a170902bf0400b00149c5a55323mr24813906plb.97.1650532049802; Thu, 21 Apr 2022 02:07:29 -0700 (PDT) Received: from localhost (193-116-116-20.tpgi.com.au. [193.116.116.20]) by smtp.gmail.com with ESMTPSA id b5-20020a056a0002c500b0050600032179sm22557180pft.130.2022.04.21.02.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 02:07:29 -0700 (PDT) Date: Thu, 21 Apr 2022 19:07:24 +1000 From: Nicholas Piggin Subject: Re: [PATCH v4 bpf 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP To: Linus Torvalds Cc: "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" , Mike Rapoport , "song@kernel.org" , Song Liu 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: MIME-Version: 1.0 Message-Id: <1650531495.h5u7ntu1jb.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE 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 Excerpts from Linus Torvalds's message of April 21, 2022 4:02 pm: > On Wed, Apr 20, 2022 at 10:48 PM Linus Torvalds > wrote: >> >> The lagepage thing needs to be opt-in, and needs a lot more care. >=20 > Side note: part of the opt-in really should be about the performance impa= ct. >=20 > It clearly can be quite noticeable, as outlined by that powerpc case > in commit 8abddd968a30 ("powerpc/64s/radix: Enable huge vmalloc > mappings"), but it presumably is some _particular_ case that actually > matters. >=20 > But it's equalyl clearly not the module code/data case, since > __module_alloc() explicitly disables largepages on powerpc. >=20 > At a guess, it's one or more of the large hash-table allocations. The changelog is explicit it is the vfs hashes. > And it would actually be interesting to hear *which*one*. From the > 'git diff' workload, I'd expect it to be the dentry lookup hash table > - I can't think of anything else that would be vmalloc'ed that would > be remotely interesting - but who knows. I didn't measure dentry/inode separately but it should mostly (~entirely?) be the dentry hash, yes. > So I think the whole "opt in" isn't _purely_ about the "oh, random > cases are broken for odd reasons, so let's not enable it by default". The whole concept is totally broken upstream now though. Core code absolutely can not mark any allocation as able to use huge pages because x86 is in some crazy half-working state. Can we use hugepage dentry cache with x86 with hibernation? With BPF? Who knows. > I think it would actually be good to literally mark the cases that > matter (and have the performance numbers for those cases). As per previous comment, not for correctness but possibly to help guide some heuristic. I don't see it being too big a deal though, a multi-MB vmalloc that can use hugepages probably wants to, quite small downside (fragmentation being about the only one, but there aren't a vast number of such allocations in the kernel to have been noticed as yet). Thanks, Nick