From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32B5D2FDC52 for ; Fri, 14 Nov 2025 08:48:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763110100; cv=none; b=Y9WNFGKhDSNBqVvGHHF2o+b5wvOcPYX+RQnnCJ2KQUkVjagRcY2Ns5JERaIfXamyXY/iix1r/7BV7mUtsCtokEVSEe/hqJs0qHxasmOlllogp9CXL0C8w1jQ603Ui5Y+RjaCupHBp95HVlob1xK04FkJIX1xKEvstyv/+C1rzu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763110100; c=relaxed/simple; bh=6J5WmzVtC+H81aCtjDmNLNsnnHIN/N8pN80gao2Z6wg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z3czxlkGgHHE/djfZRrO3jrWfNtqD2l4iNkN7C9udj/9/JYIY+i766qHxk4QfTMA0VOj3Z4m/3IiIwHEntIsU7eBRDPMbBpbOKjuo1/HU8T63aa1Xf+4AFpFk1aVvDKkVPcrHROJFdhB2ltbNeIdsskjopTxWzDXREZTS6Zo+F0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ho4enqty; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=HsvVl0bC; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ho4enqty; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=HsvVl0bC; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ho4enqty"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="HsvVl0bC"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ho4enqty"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="HsvVl0bC" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id 1E0581F391; Fri, 14 Nov 2025 08:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1763110096; 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=6NewmV1pcDRKaQJIMUZo/MiTJQZGP+1ogl/0KLlMvZg=; b=ho4enqty3nkFp0hbRfLy8VUI0H4OOw/xm3G7MPvC+YrDIMw2wXluMTP0oYeycDf3OFJA6O 3dgyexc/9pw+jIhrDpDMjF/mpyarhpFoUPY6a3j9/bdjXSVpTVfQYoIFQwMoYnBfIidZa5 eyugQI45k0GRdIIIBNO2P5s9YUaXpdg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1763110096; 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=6NewmV1pcDRKaQJIMUZo/MiTJQZGP+1ogl/0KLlMvZg=; b=HsvVl0bCZHHZ2oHzggJbblAZniayaB0mjhAn7R3i0UoXoimiTcqqA3YurAndL8yL9yRm0z qUeWaAcJx3AyuTDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ho4enqty; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=HsvVl0bC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1763110096; 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=6NewmV1pcDRKaQJIMUZo/MiTJQZGP+1ogl/0KLlMvZg=; b=ho4enqty3nkFp0hbRfLy8VUI0H4OOw/xm3G7MPvC+YrDIMw2wXluMTP0oYeycDf3OFJA6O 3dgyexc/9pw+jIhrDpDMjF/mpyarhpFoUPY6a3j9/bdjXSVpTVfQYoIFQwMoYnBfIidZa5 eyugQI45k0GRdIIIBNO2P5s9YUaXpdg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1763110096; 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=6NewmV1pcDRKaQJIMUZo/MiTJQZGP+1ogl/0KLlMvZg=; b=HsvVl0bCZHHZ2oHzggJbblAZniayaB0mjhAn7R3i0UoXoimiTcqqA3YurAndL8yL9yRm0z qUeWaAcJx3AyuTDA== 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 DC9B33EA61; Fri, 14 Nov 2025 08:48:15 +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 TxvgM8/sFmnmKgAAD6G6ig (envelope-from ); Fri, 14 Nov 2025 08:48:15 +0000 Date: Fri, 14 Nov 2025 09:48:14 +0100 From: Jean Delvare To: SeongJae Park Cc: linux-mm@kvack.org, LKML , David Hildenbrand Subject: Re: [PATCH] mm/cma: Remove CONFIG_CMA_SYSFS option Message-ID: <20251114094814.3b2efb09@endymion> In-Reply-To: <20251114010928.151974-1-sj@kernel.org> References: <20251113145636.731a24e4@endymion> <20251114010928.151974-1-sj@kernel.org> Organization: SUSE Linux X-Mailer: Claws Mail 4.2.0 (GTK 3.24.43; x86_64-suse-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Level: X-Spam-Flag: NO X-Rspamd-Queue-Id: 1E0581F391 X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; HAS_ORG_HEADER(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -4.01 Hi Seong Jae, On Thu, 13 Nov 2025 17:09:27 -0800, SeongJae Park wrote: > On Thu, 13 Nov 2025 14:56:36 +0100 Jean Delvare wrote: > > > The sysfs interface to CMA has a marginal runtime cost and a small > > footprint, there's no reason not to include it in all kernels where > > the dependencies are satisfied. > > Overall change looks good to me. I have a question below, though. > > > > > Signed-off-by: Jean Delvare > > --- > > As discussed with David: > > https://lkml.org/lkml/2025/8/6/371 > > > > arch/loongarch/configs/loongson3_defconfig | 1 - > > arch/s390/configs/debug_defconfig | 1 - > > arch/s390/configs/defconfig | 1 - > > mm/Kconfig | 7 ------- > > mm/Makefile | 4 +++- > > mm/cma.h | 4 ++-- > > 6 files changed, 5 insertions(+), 13 deletions(-) > > > > --- linux-6.17.orig/arch/loongarch/configs/loongson3_defconfig > > +++ linux-6.17/arch/loongarch/configs/loongson3_defconfig > [...] > > --- linux-6.17.orig/mm/cma.h > > +++ linux-6.17/mm/cma.h > > @@ -49,7 +49,7 @@ struct cma { > > char name[CMA_MAX_NAME]; > > int nranges; > > struct cma_memrange ranges[CMA_MAX_RANGES]; > > -#ifdef CONFIG_CMA_SYSFS > > +#ifdef CONFIG_SYSFS > > /* the number of CMA page successful allocations */ > > atomic64_t nr_pages_succeeded; > > /* the number of CMA page allocation failures */ > > @@ -80,7 +80,7 @@ static inline unsigned long cma_bitmap_m > > return cmr->count >> cma->order_per_bit; > > } > > > > -#ifdef CONFIG_CMA_SYSFS > > +#ifdef CONFIG_SYSFS > > void cma_sysfs_account_success_pages(struct cma *cma, unsigned long nr_pages); > > void cma_sysfs_account_fail_pages(struct cma *cma, unsigned long nr_pages); > > void cma_sysfs_account_release_pages(struct cma *cma, unsigned long nr_pages); > > Why don't you check CONFIG_CMA together? I think that makes the change more > complete and safe. > > I found there is no file that can be compiled without CONFIG_CMA but still > including this header file, so I expect no real issue for now, though. This would actually make no difference. This header file is internal and not expected to be included by any file besides that CMA core itself, so it is assumed that CONFIG_CMA=y whenever this header file is used. If not, then things would break already, even without my proposed changes (due to cma_areas and cma_area_count being declared but never defined). -- Jean Delvare SUSE L3 Support