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 F39E4C71136 for ; Wed, 11 Jun 2025 18:33:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B2BD6B0093; Wed, 11 Jun 2025 14:33:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 663A46B0095; Wed, 11 Jun 2025 14:33:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5797C6B009B; Wed, 11 Jun 2025 14:33:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3ACFF6B0093 for ; Wed, 11 Jun 2025 14:33:03 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B7240101C2F for ; Wed, 11 Jun 2025 18:33:02 +0000 (UTC) X-FDA: 83543966604.16.0CF8AA2 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf28.hostedemail.com (Postfix) with ESMTP id 03632C0004 for ; Wed, 11 Jun 2025 18:33:00 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=hFUbODkD; dkim=pass header.d=linutronix.de header.s=2020e header.b=YMKYs47M; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf28.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749666781; 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=KVJQYwb9SrBvPQZMWRLSiDunk5GTagoaANqdNS9mj1Q=; b=Zoti0sMK3n+1Zuw77VPcH8zzZE1xXeXvLV5qi+f0xkYvUKaFrw6TPtFRblMyTCxAvjaQst DHMwzBeARyf7S6qDxwWqYaNjURLcc8cASGMmJEfMbw71yiGQtv2pFBT/oskIiWHLxux5N7 fcWPJhS8It+pmGRlDi/MknZzu+Jh3U4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=hFUbODkD; dkim=pass header.d=linutronix.de header.s=2020e header.b=YMKYs47M; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf28.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749666781; a=rsa-sha256; cv=none; b=2uhWs1ry0d+ZlLEUYu747Bf10MU0+I7BL8lyPr44MqZhoizs9UkbBoRD7vz+ROT0q+A/Uf 0RqDHlR0xuhdNWwp4CWDSnw7+nOs5Bx7fbaxiq9l5XhK2fAmCKbtqEBp3TkDS2peRZ7BXe BqHWS20T3+j7beCBd82Gl4/HQlhIiLQ= Date: Wed, 11 Jun 2025 20:32:57 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749666778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KVJQYwb9SrBvPQZMWRLSiDunk5GTagoaANqdNS9mj1Q=; b=hFUbODkDFwp67Ymbwn9/NBjfw2phFcwp7vfGkfNboneZ9bfkTjuUcBZDx6ypS7Y7gnKUcd RLdi0L7cBXYomzA6lMJF4BfoUQ7/0Cpnf28P41u4cEHqYLXTQ2tPIE3xkMOCd1rKrgW1Ht tEQzxqxlITDdh4XgXhqsUOPUbE8121DqX/JkQ0yPB46aOdA+KJcW1EWRRyiqbshVEKSYXE 3ww69g7cKBl5UAAUbQSQCORd4VYGadZ8Qoeo16Iuo/IQutenTCl8r0zD43BRKlLC9Z4QL7 M9pJEYtL8tg2ClpbUGtm03VV8+o2PdwtTRmNMX4aLJVbufkLdoV/rzVGOC0AFQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749666778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KVJQYwb9SrBvPQZMWRLSiDunk5GTagoaANqdNS9mj1Q=; b=YMKYs47MDt7NeifANxzZHgs/P2SlXwcWOLGcDG/Ctr6DoXKTVRU0DK+JwRidzJWlKyYW45 IfM+lbRkNP4CS6Bg== From: Sebastian Andrzej Siewior To: Tejun Heo Cc: linux-mm@kvack.org, Dennis Zhou , Christoph Lameter , Gal Pressman , Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH] mm: percpu: Increase PERCPU_MODULE_RESERVE Message-ID: <20250611183257.luuJewNy@linutronix.de> References: <20250611161849.BfhxVtnk@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 03632C0004 X-Stat-Signature: wnb96n117dsrieeh88kw5uydmoxm5m9e X-Rspam-User: X-HE-Tag: 1749666780-366260 X-HE-Meta: U2FsdGVkX182KgcdMidus9nClaLyQQOgV6cVHZHyxfZY8Q1OqoWPuuOyMr7Xmja1tkAQfe0lpSqeqxvI7ABsmeOSkkHE30JqPc1Rs6xcTevqPKmLY3t4iBa7WC0zCvr2fDlqtN0xFLYybL3yQL/k2pVVZr+hXK7x/9gk6LjJxRIiHcKnwLeXnYOMc27V5X/65nG0EABf7Uhp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ux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2025-06-11 07:45:46 [-1000], Tejun Heo wrote: > On Wed, Jun 11, 2025 at 06:18:49PM +0200, Sebastian Andrzej Siewior wrote: > > PERCPU_MODULE_RESERVE defines the maximum size that can by used for the > > per-CPU data size used by modules. This is 8KiB. > > > > Commit 035fcdc4d240c ("openvswitch: Merge three per-CPU structures into > > one") restructured the per-CPU memory allocation for openvswitch and > > moved the separate alloc_percpu() invocations at module init time to a > > static per-CPU variable which is allocated by the module loader. > > > > The size of the per-CPU data section for openvswitch is 6488 bytes which > > is ~80% of the available per-CPU memory. Together with a few other > > modules it is easy to exhaust the available 8KiB of memory. > > > > The memory range for the per-CPU memory is allocated early and pages for > > its backing are only allocated once the per-CPU memory is allocated. > > Increasing the map from 8 to 16 KiB adds 256 bytes to the alloc_map and > > bound_map and 64 bytes to md_blocks (576 bytes in total). > > > > Increase the available memory for module's per-CPU data section to > > 16KiB. > > I think a better direction would be keeping using alloc_percpu(). There > aren't a lot of benefits to using static definitions compared to dynamic > ones and making it larger increases overhead for everyone. I could avoid initialising per-CPU locks because of the static build time init and avoid the alloc_percpu() at module init. I can access members of the struct avoid one pointer dereference. All this for 576 bytes. > Thanks. Sebastian