Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2837384iof; Wed, 8 Jun 2022 13:08:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7gL6tjNseIqLFUKXYhjl5lxAG7EOSNAQN1fwSB6s29nJrDL6TtCw9wlkfHdD2Aupe1Q48 X-Received: by 2002:a05:6a00:2148:b0:4fa:92f2:bae3 with SMTP id o8-20020a056a00214800b004fa92f2bae3mr36309202pfk.69.1654718928907; Wed, 08 Jun 2022 13:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654718928; cv=none; d=google.com; s=arc-20160816; b=hprhrAf1QdPyWWmL/7FESSHvWn0aVZS5XcsrU8Ei/XRlZBrRQgw92oM1E6J1CBxw8I if7RLTZkG65BSI1Jn2EWllV0osjd1t+qv0kqJq3lfgXihfKtGuWhVSUk65m/tH6ka81E AJVBOokkFw/slqtOdNOMyxaloAfdkL1ohHnLaAtdeJQGcSJU+H0NNoSGG3O1WJ6qtflt D1VmDcDnYfOzt5SlS+BT77JnQokM0CNuUF6hBCOX1oorIdLOX3Jm9cF2Jj+ctWK36Bl3 TKzEvFxH94LNzpfrQMNlXCZoNgEe6R1t5R3EVR+i23Uxwgk3l9itkihXm/dL2ET5lDic wHTQ== 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=BhtzZ9/+YJ8kUb1nFAroKIyulEyrhISYonq+AswBPr0=; b=oeXxoAZiTRZUlayZnHT3eSLy3J2vZ5oCXawY0xsujC2CMjCfzTO+j/MCrgerFCid1b oCjKSPf/Y8s46a2v73+oJwdZ3RO0MAjtayQXBlbQK7YZsKnWrsEtcDQR+z6yIA58Df2/ uchidnHPvT/D7GKiM2Lg77VB/yLgnmRYKPKJhKuKhS15CyAe4+4BOpY7uDtGvU+aMxpt 0vK8XhUg3DPKSrZejjyB9mtNI3ogQYcRy5EDTXl/SVE4KD2+uWx40y546muDwTiFYJYk 2rPNnx0SGz2djF1xoB1wgsGVsm/BhzZByV6cs2o4i6NEkUT6BR+MMjs699ByevXlgXDV BuoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TcmsN9mO; 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 70-20020a630149000000b003fd4f3a46c0si19975923pgb.391.2022.06.08.13.08.36; Wed, 08 Jun 2022 13:08:48 -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=TcmsN9mO; 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 S233035AbiFHTqF (ORCPT + 99 others); Wed, 8 Jun 2022 15:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbiFHTqD (ORCPT ); Wed, 8 Jun 2022 15:46:03 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D7C2755B8 for ; Wed, 8 Jun 2022 12:46:01 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 25so28203679edw.8 for ; Wed, 08 Jun 2022 12:46:01 -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=BhtzZ9/+YJ8kUb1nFAroKIyulEyrhISYonq+AswBPr0=; b=TcmsN9mOlA8bP2rZnnucTbbVTFpfHrbBTVeCL/Pi1vlWrTzL5v327k8N9s5oN9q0WY ZKDjqXOfAw1qGniZ7H5FXu4txkapnU15nG6VG93XcpVhPMMSZOLrwsHwfZnzNuST7sad /5szK7e4nkKLsKiIH7Tq9qY45jhAL/JhE1NA8= 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=BhtzZ9/+YJ8kUb1nFAroKIyulEyrhISYonq+AswBPr0=; b=EytSWwTnQu7flpsxzx49gxBVYaVqZWvfbtJGov4NslX8W/ShavvHQ725enRoHbsL69 tV2Z/HD3nPFA1aDlCxg86Ekz3GkOe4Y7JwqWXQBW7JHvhlEhdlAzB7tdctYXIEbEZ0gG noM2jXP7Qwm9A9TQQPAGU5i/tMU5Pq78EhqXaQ8uPK1NBsw8dH2obpplLzXyRZK1aDz+ LIWtC/Omsd9l8s4xTv6Uv5OZatMV2CNwuPuQlVVFr9vyi7MpEW57gT/qFIfHTV3xQAUe PKOpsxW95D7pUsitZe6m+fbL4IdR7sVDU2GjCqkf17RVHB+K9ckM6na4EBp8eNNLaiAi AbDw== X-Gm-Message-State: AOAM5338XSYjK+F+vBdLMLsQJHO5GnAG2dylJ08dutj8LqyvxpPG/rwC 9WTcDjgQArAbwJWeXfMNhiAH47RX27c8e8TG X-Received: by 2002:aa7:c054:0:b0:433:2d3b:10ed with SMTP id k20-20020aa7c054000000b004332d3b10edmr3303325edo.211.1654717559977; Wed, 08 Jun 2022 12:45:59 -0700 (PDT) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id pk16-20020a170906d7b000b006fee526ed72sm9380728ejb.217.2022.06.08.12.45.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jun 2022 12:45:59 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id r123-20020a1c2b81000000b0039c1439c33cso11609302wmr.5 for ; Wed, 08 Jun 2022 12:45:59 -0700 (PDT) X-Received: by 2002:a05:600c:42c6:b0:39c:4bfd:a4a9 with SMTP id j6-20020a05600c42c600b0039c4bfda4a9mr850467wme.8.1654717201668; Wed, 08 Jun 2022 12:40:01 -0700 (PDT) MIME-Version: 1.0 References: <20220606202109.1306034-1-ankur.a.arora@oracle.com> <87k09s1pgo.fsf@oracle.com> <877d5rt0uz.fsf@oracle.com> In-Reply-To: <877d5rt0uz.fsf@oracle.com> From: Linus Torvalds Date: Wed, 8 Jun 2022 12:39:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 00/21] huge page clearing optimizations To: Ankur Arora Cc: Linux Kernel Mailing List , Linux-MM , "the arch/x86 maintainers" , Andrew Morton , Mike Kravetz , Ingo Molnar , Andrew Lutomirski , Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Andi Kleen , Arnd Bergmann , Jason Gunthorpe , jon.grimm@amd.com, Boris Ostrovsky , Konrad Rzeszutek Wilk , Joao Martins 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,T_SCC_BODY_TEXT_LINE 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, Jun 8, 2022 at 12:25 PM Ankur Arora wrote: > > But, even on x86, AFAICT gigantic pages could straddle MAX_SECTION_BITS? > An arch specific clear_huge_page() code could, however handle 1GB pages > via some kind of static loop around (30 - MAX_SECTION_BITS). Even if gigantic pages straddle that area, it simply shouldn't matter. The only reason that MAX_SECTION_BITS matters is for the 'struct page *' lookup. And the only reason for *that* is because of HIGHMEM. So it's all entirely silly and pointless on any sane architecture, I think. > We'll need a preemption point there for CONFIG_PREEMPT_VOLUNTARY > as well, right? Ahh, yes. I should have looked at the code, and not just gone by my "PREEMPT_NONE vs PREEMPT" thing that entirely forgot about how we split that up. > Just one minor point -- seems to me that the choice of nontemporal or > temporal might have to be based on a hint to clear_huge_page(). Quite possibly. But I'd prefer that as a separate "look, this improves numbers by X%" thing from the whole "let's make the clear_huge_page() interface at least sane". Linus