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 BCC62C4332F for ; Thu, 14 Dec 2023 08:41:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24D946B0477; Thu, 14 Dec 2023 03:41:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FBD26B0478; Thu, 14 Dec 2023 03:41:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0758B6B0479; Thu, 14 Dec 2023 03:41:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E7FB36B0477 for ; Thu, 14 Dec 2023 03:41:03 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BEE7CC028E for ; Thu, 14 Dec 2023 08:41:03 +0000 (UTC) X-FDA: 81564778806.03.739AF75 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by imf19.hostedemail.com (Postfix) with ESMTP id 17AFF1A001B for ; Thu, 14 Dec 2023 08:41:01 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.179 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702543262; 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; bh=aQbR2JO/KFK5RF93JUmmx4V523VsDvrN1w2XiDVyh7c=; b=UO8OVrVvz5ShfT1N+ERY9MDHEChhrS3YiZxxZMja5VSAfMb46DWcdy/DOL3sDJ8Og7RZh4 4xZyIWP+LaQlwO57XvEFWa4T+zgN394DmIaWYQnIox2G0NWbgUGyD7J0OA0MDCbx3xQoUX YNkxzqzSsbacgjLkiTehAEFZxELHCWo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.179 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702543262; a=rsa-sha256; cv=none; b=nNxVcJZaiThuL0l1H/f8VZENIoFsTkZN/GB6tpd8tQfjpR0HyxQ/LH6KthctQhMLwLu0a9 JbTkFHxrQ1TIjJvrv68JbOAt3TiEZu4WjEj+mDSuGJhv25kqgesq7Cx3mn46tUJ7WMUvcg nKO0PfaXP0vVN6DpVUpDhbF9vylVXlA= Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-35f418f394dso21642255ab.0 for ; Thu, 14 Dec 2023 00:41:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702543261; x=1703148061; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aQbR2JO/KFK5RF93JUmmx4V523VsDvrN1w2XiDVyh7c=; b=p2asjyNel7Y4JaKgaWVxUY+w+Rw54zK11qFBe0z+Ov8wFO06qdfRVbiEGDyc8zDsAI 8hi5+9bHHCM54q9vk+svO2DiiWY9aq8eh4HFXrpMOzioapUddzDv4vxMdw1u+Y5DxYN1 SVGxRbeKW7C5ALut+DvGpcBnQVT6dPSW+rMwKHX9C83E4nQBCEeA0uIeGIkg5xY53jlc 95wBXZpH8VqvPrJnm+MRRvNuhbeTGyMVqCJYb1eA+aOhMbMQOHpnA0FKDxWtOu1N3osw PPEIVfE328Yr3jYVwRUokdKEoUwDqxDYhKdiguHhp3aJnj55ZmYuC0wLf5SJ5Ma49gUM apJg== X-Gm-Message-State: AOJu0YzmgisrO2M0wNs5M2rbBAwu3h5U+TOQjY/XgRl4eDxm4juyfUHg SArnDs8aHa2C9GDwkUnamRM= X-Google-Smtp-Source: AGHT+IHTijws84bT+t+wUZlzE5DTLKpXqSjvyPgKeN8xOqYkuQ5p52nrDNR5ore1Nt4kSFPYClVCrA== X-Received: by 2002:a05:6e02:1c4d:b0:35f:7629:87d3 with SMTP id d13-20020a056e021c4d00b0035f762987d3mr2870814ilg.43.1702543261164; Thu, 14 Dec 2023 00:41:01 -0800 (PST) Received: from snowbird ([136.25.84.107]) by smtp.gmail.com with ESMTPSA id o2-20020a1709026b0200b001cfad034756sm11747930plk.138.2023.12.14.00.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 00:41:00 -0800 (PST) Date: Thu, 14 Dec 2023 00:40:58 -0800 From: Dennis Zhou To: Alexandre Ghiti Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Arnd Bergmann , Tejun Heo , Christoph Lameter , Andrew Morton , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 0/2] riscv: Enable percpu page first chunk allocator Message-ID: References: <20231212213457.132605-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212213457.132605-1-alexghiti@rivosinc.com> X-Rspamd-Queue-Id: 17AFF1A001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: p7teg6qowgxkpshqpx6cz1hgdesytqm6 X-HE-Tag: 1702543261-643658 X-HE-Meta: U2FsdGVkX1/vz8SS20GxLIk//UUl2SbE0ztgex9iDpxUmAoReZYhMKTqUJQ3kEzMxOTBTSS4wpn7jZw4TrVy2j5IgOqsf1LCfQaMTLhPNSravUJGdfSSOWUM4lpc1ul0taaDlNDSe6Kf4i69xvykF4T+5wbe7hyIh4opoi1xEdhhbMVi51CVt4DQVWziIml6gl7yQegTwRN0vwtJcSybw0njmFa+cKLEiRJpkEF69ojVgkhGZBjA37qFEhnlyxwmvNoW1Qo63OseqdcDExexocVuATso0b2rPw0vOrAXjo8hXYV5cruxfSDL7fjbrsrK3941946Guv4oLlLNYovjefkN9In4BqFZcC4KAgSpmnsQgGmIZ1YyIoxT7JGLcVizJN7OgMcoG3FOjEip4BNHTtUNi6E5HvCdSbbfa/VX0IpgpDmp3p0IINNvd6yS6rzx4eZahskhnE4H1E+gzlshJdpRFAxZIMi3+ajzsu1JTGMAXOs23jlbTJvk4p1eojwaC6GLo1Fa9QsqSEoc9P9TJh54neI7211hIBbMzt/R0Lob1YsElr3+gIk2NMSEB3WYGIv7Z19pVUTcYk6WBPvKK2zyfi2SfyNOsZeaG+Y2fw4OVAfdeIxtOsoMFlFbFbg5penrRKuA9Xv98Q1W1qtLzqj/bK8mnHGmDr6p79biNPKnhDlK45H5JXknzJA268sodiXuAkHQc72t0eYxL5LRYmv8t1NE3SsBKb+fKHnsFeRsNCDO1sEuGySnMtOqqUaAqT5c3jaPETrqYQhJxwJcXYxLsq+BGyQrrAqDcieGtbbRI53gLS0D26jIbGO+iFBph7sqzwje6A0HW8QmSNJdj2eLpK+emtJuv5bTXsPNCZtKXiKklwcCD6EOMhy2BX7xHFIt61QNAo8FLaYuHQBJor2X0PnWe39DMsi0Hbxjv8eQuK8wHKKrYDOOUaO7xyJAelF9ALttIcZ0hfkvd9S pDHlqZdR knUBTp599FE4WOy+o33F9IMNFKBfUoufePyLzuYEgpuD5Mo8tnuOWOKU4bNanFCjxNJS/xI/Wa3r19qdv1eJVsW5IvHaHe6MvJYJCDy8DSqPaeXsbAzLbc9OqoriGbRqe8hGmdsjZb3HpXXIvObTwj3tp4Zug6n+UHBTIU6x8+vaRw4+SSiELbeKUWFPKUtMSgpzmEHKSHjTiInPTAj+MJjM2ngZQuXdrWRuWVyVmPn8NICnRJ9c2IRT+Ra2Gtwdy+OqXjc5ynH7hXpFBsKLSHUu6gHxb05UGeR2/nDEQ8GsyjtC9dOlPOWqc7gZvtTyjkKPeNv5diiO2zUbchv9wRZfpneEPBT4+VpHSxOMgwLB/Xi63Y/Gkuku/1nNUTLGI7iWGmw/CBoicQ56pFPgCet0JQhz7WCTrFLW1NPVm1o7HVqzOepuiy7euPLVCNA12JFABfpHagVyYYmyFMmFGHZ6BTqLDEnR4Fk60wJD12XLXM9iAfDUi8q5LQlQHjNvIzo/lcJ2p/ck4GAgF8yDp7C3J5yaQtMEMzYpoe+Y41yju6IY= 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: List-Subscribe: List-Unsubscribe: Hello, On Tue, Dec 12, 2023 at 10:34:55PM +0100, Alexandre Ghiti wrote: > While working with pcpu variables, I noticed that riscv did not support > first chunk allocation in the vmalloc area which may be needed as a fallback > in case of a sparse NUMA configuration. > > patch 1 starts by introducing a new function flush_cache_vmap_early() which > is needed since a new vmalloc mapping is established and directly accessed: > on riscv, this would likely fail in case of a reordered access or if the > uarch caches invalid entries in TLB. > Note that most architectures do not include asm-generic/cacheflush.h so to > avoid build failures, this patch implements the new function on each of > those architectures. For all architectures except riscv, this new function > is implemented as a no-op to keep the existing behaviour but it likely > needs another implementation. > > patch 2 simply enables the page percpu first chunk allocator in riscv. > > Changes in v2: > - Rebase on top of 6.7 > - Define flush_cache_vmap_early() for all architectures that do > not include to avoid build failures > > Alexandre Ghiti (2): > mm: Introduce flush_cache_vmap_early() > riscv: Enable pcpu page first chunk allocator > > arch/arc/include/asm/cacheflush.h | 1 + > arch/arm/include/asm/cacheflush.h | 2 ++ > arch/csky/abiv1/inc/abi/cacheflush.h | 1 + > arch/csky/abiv2/inc/abi/cacheflush.h | 1 + > arch/m68k/include/asm/cacheflush_mm.h | 1 + > arch/mips/include/asm/cacheflush.h | 2 ++ > arch/nios2/include/asm/cacheflush.h | 1 + > arch/parisc/include/asm/cacheflush.h | 1 + > arch/riscv/Kconfig | 2 ++ > arch/riscv/include/asm/cacheflush.h | 3 ++- > arch/riscv/include/asm/tlbflush.h | 1 + > arch/riscv/mm/kasan_init.c | 8 ++++++++ > arch/riscv/mm/tlbflush.c | 5 +++++ > arch/sh/include/asm/cacheflush.h | 1 + > arch/sparc/include/asm/cacheflush_32.h | 1 + > arch/sparc/include/asm/cacheflush_64.h | 1 + > arch/xtensa/include/asm/cacheflush.h | 6 ++++-- > include/asm-generic/cacheflush.h | 6 ++++++ > mm/percpu.c | 8 +------- > 19 files changed, 42 insertions(+), 10 deletions(-) > > -- > 2.39.2 > Thanks for the quick v2. Applied to percpu#for-6.8. Thanks, Dennis