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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7835C433EF for ; Wed, 8 Jun 2022 19:40:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33E876B0071; Wed, 8 Jun 2022 15:40:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C6786B0072; Wed, 8 Jun 2022 15:40:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1400C6B0073; Wed, 8 Jun 2022 15:40:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 04E876B0071 for ; Wed, 8 Jun 2022 15:40:06 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id C5F99606AA for ; Wed, 8 Jun 2022 19:40:05 +0000 (UTC) X-FDA: 79556084370.30.36A5D94 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by imf04.hostedemail.com (Postfix) with ESMTP id 4CD1E4006B for ; Wed, 8 Jun 2022 19:40:05 +0000 (UTC) Received: by mail-ej1-f49.google.com with SMTP id v1so32748820ejg.13 for ; Wed, 08 Jun 2022 12:40:04 -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=mOqTELu4F50SuglJ7FvU1qeWbJ02VULregGroUOrX5qy7mO3iZvajhZrx6E5SIcKyT CFNhfmrEgV+yKySVnRPNkROicQnat2eG/42jMmgnzu7KJ6a+K8AdjEmRMlkCxrSoj4Vn xOjD/wF7nwDOdBJuVQOTMJJ/fNcJCfzUvwhaUvT4NGxodQM8NJgnCdvuu7SYeFqIsi3s n5S17rKE6aCA+6zFUYHYpW2kqc8fkjJQlS0al8ez9lyCd6KFladJaI3JLGYTVF40zuue K+qjQ4JILleOxAJgJiPxd5TzBt5F7p+3ne8MzyViE/gO4Eii8TfvybAhLVFBACIyIfvP pXNg== X-Gm-Message-State: AOAM5302Ea/JoJu67bf2iEu03eMnr+iR/qeFQxws6ikupfbU+hckrUWR QEuFe4jg+Z55xSFlwz4cuWk8fP+OEv3mnBFL X-Google-Smtp-Source: ABdhPJyIbig2YFHysqxdhhngGUqALfMkHq/d3Bt/2phgBIhKbFurBscwNQlMI6zpY5mPmd/g5JUJsA== X-Received: by 2002:a17:907:6e90:b0:711:cb3c:8c1a with SMTP id sh16-20020a1709076e9000b00711cb3c8c1amr17857616ejc.516.1654717203622; Wed, 08 Jun 2022 12:40:03 -0700 (PDT) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com. [209.85.128.51]) by smtp.gmail.com with ESMTPSA id zo11-20020a170906ff4b00b00709343c0017sm8861748ejb.98.2022.06.08.12.40.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jun 2022 12:40:02 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id a10so8894087wmj.5 for ; Wed, 08 Jun 2022 12:40:02 -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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654717205; a=rsa-sha256; cv=none; b=gECSIDu3nQan65hQotzcb1MntHMA4M9jER65NUrW50PVPCDROEvNfHc+tIoEhHW9XRT4g/ dkdoPHDgdrtw0TKpJB0Tsnm+FbQz6/xb9yUnT7Jcv+oCoYksvl4gke+xaHXAOqSekyYoei LTOsXBzBW3LHdC/Nl/QDYZJDbwjI2RA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=TcmsN9mO; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.218.49 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654717205; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BhtzZ9/+YJ8kUb1nFAroKIyulEyrhISYonq+AswBPr0=; b=ptbifXfUsguEore3oEPdqFeGU1xgMR05I0MLKx9rkTTJJEEliNClXhxxbxas+Ztw298ji1 FFEo4vJoWkofAR6KPKgQucqYcpS6xoX+dYEJXwjAuK22VyoTXNLTgkuosaNjjsfAPbCEZ2 pJ3E2L6ykdTjvzpzaERSwRJvXgLHoWY= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4CD1E4006B X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=TcmsN9mO; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.218.49 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Stat-Signature: nkg91dbkn4sakk4ha99oxdweomg3cpqq X-HE-Tag: 1654717205-76107 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 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