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 90380C3ABC3 for ; Mon, 12 May 2025 14:52:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7857E6B015C; Mon, 12 May 2025 10:52:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7350B6B015E; Mon, 12 May 2025 10:52:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FD416B015F; Mon, 12 May 2025 10:52:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3E27C6B015C for ; Mon, 12 May 2025 10:52:44 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 89FA4E31A2 for ; Mon, 12 May 2025 14:52:45 +0000 (UTC) X-FDA: 83434547490.21.456F6F4 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf24.hostedemail.com (Postfix) with ESMTP id 24A8E180018 for ; Mon, 12 May 2025 14:52:42 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=yQgRKVzk; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ZIqE74n7; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=yQgRKVzk; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ZIqE74n7; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747061563; a=rsa-sha256; cv=none; b=tfzmcKg+kh8do5TFq2Wcku9tUdT0h2PLYuFguDOttxUeu7eAlphRUGlY8NTbSOnY95mZJN OZC2qtk2LCp/aDnclqNNa2bjKoKl05TMm2NtYHPmxpPUPwAyjycOy8IIlOdVpZUCvsKOFQ tc4GMfrge7REbGZf3/zHaq2DaplR5w8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=yQgRKVzk; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ZIqE74n7; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=yQgRKVzk; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ZIqE74n7; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747061563; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=K9UHevEDnKSe6Z9iaB3T6ATKSeVwm+Arr0x7pCh7tqU=; b=Ft11oxlQm15PNB8Uf96CjoNOZbW7Dhu6eFoBquwkHwU7zhGygT3A0cqrsKyfO3RqFjDcud jI9DLwEHqnQ9IlHJGmj/5+WqdrSmnQCLEvJD7st3OqzN9zOTWPf9weptgMaXhVRIJs1uBF NskPSF1ZM1K/OG7FXjIDup/4LUpwdaI= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 93BD82119D; Mon, 12 May 2025 14:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1747061561; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K9UHevEDnKSe6Z9iaB3T6ATKSeVwm+Arr0x7pCh7tqU=; b=yQgRKVzk/Y1oFtP7jSXkNSxq5SQWRTNqrBwWjZScYD+1t3h1yeeR/U0ifcNli6pngFK9/H i9rdvpWhflmGq2B5Npqvt33CVAwZKXVQxHy6UL6KV4qmqRdQqjHuBN8DPokf165T84SA+E 392kkXyy5xyREUSF1cuEeq85LxyAMZs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1747061561; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K9UHevEDnKSe6Z9iaB3T6ATKSeVwm+Arr0x7pCh7tqU=; b=ZIqE74n7cFg7putyLdOi9vmvyNeoHwhIMS08bhUEJymS8geMt2xCLSvh4zFo1pTzLD/3lD CIYiUpDzG5IFkGBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1747061561; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K9UHevEDnKSe6Z9iaB3T6ATKSeVwm+Arr0x7pCh7tqU=; b=yQgRKVzk/Y1oFtP7jSXkNSxq5SQWRTNqrBwWjZScYD+1t3h1yeeR/U0ifcNli6pngFK9/H i9rdvpWhflmGq2B5Npqvt33CVAwZKXVQxHy6UL6KV4qmqRdQqjHuBN8DPokf165T84SA+E 392kkXyy5xyREUSF1cuEeq85LxyAMZs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1747061561; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K9UHevEDnKSe6Z9iaB3T6ATKSeVwm+Arr0x7pCh7tqU=; b=ZIqE74n7cFg7putyLdOi9vmvyNeoHwhIMS08bhUEJymS8geMt2xCLSvh4zFo1pTzLD/3lD CIYiUpDzG5IFkGBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7A455137D2; Mon, 12 May 2025 14:52:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id XRiBHTkLImgyRQAAD6G6ig (envelope-from ); Mon, 12 May 2025 14:52:41 +0000 Message-ID: <45bf0c55-42c4-4af7-8e77-ac8dba2768dd@suse.cz> Date: Mon, 12 May 2025 16:52:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] memcg: nmi-safe kmem charging Content-Language: en-US To: Shakeel Butt , Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Alexei Starovoitov , Sebastian Andrzej Siewior , bpf@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Meta kernel team References: <20250509232859.657525-1-shakeel.butt@linux.dev> <20250509182632.8ab2ba932ca5e0f867d21fc2@linux-foundation.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 24A8E180018 X-Stat-Signature: mpbny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U+J97c9C/XbCFhmiNFu76Pmk/cZ32OkB9sTwv0MBB3fNdAuxzEQ+NEU9RElnaeb9IbVt3TCcxjfwDWgAiUB0AabOuyroE3xX8bS6leYlbwR0oArGDSN5YaY6HJ1+EaDpMTJuZk97e8hTaWsWB4rnBCZViM01+gK1mR60R68hLfdvko9BJK3z7Ud4GFzZPwwPuKhtmsNuB+ag3/z9y+fQGR68ytKz5IFZSRFiTCsSmP6AIQ21hs37 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: On 5/10/25 05:11, Shakeel Butt wrote: > Before answering the questions, let me clarify that this series is > continuation of the work which added similar support for page allocator > and related memcg charging and now the work is happening for > kmalloc/slab allocations. Alexei has a proposal on reentrant kmalloc and > here I am providing how memcg charging for that (reentrant kmalloc) > should work. > > Next let me take a stab in answering the questions and BPF folks can > correct me if I am wrong. From what I understand, users can attach BPF > programs at almost any place in kernel and those BPF programs can do > memory allocations. This line of work is to make those allocations work > if the any such BPF attach point is triggered in mni context. > > Before this line of work (reentrant page and slab allocators), I think > BPF had its internal cache but it was very limited and can easily fail > allocation requests (please BPF folks correct me if I am wrong). This > was discussed in LSFMM this year as well. > > Now regarding the impact to the users. First there will not be any > negative impact on the non-users of this feature. For the value this > feature will provide to users, I think this line of work will make BPF > programs of the users more reliable with better allocation behavior. > BPF folks, please add more comments for the value of these features. Yes and I think this part of cover letter is also important: > There will be a followup series which will make kernel memory charging > reentrant for irq and will be able to do without disabling irqs. The "without disabling irqs" part will improve performance for all users.