Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2564644rbb; Wed, 28 Feb 2024 06:01:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOgsdOoQBPZWHIOPNUJHzy0MIJQx2eWH40DBYneq96nQbCKeJioH6dL/q036NCLmqNtBW335DYzsH02ZmhiJgDxQGssQ+V3LUmisAKoQ== X-Google-Smtp-Source: AGHT+IEeQwHR5LjwL6UNOURrLFLpYewOJ8RI3lSTsUG/Z1wq47CQHi4XXJG2+0yfTcHR2TdkcFEC X-Received: by 2002:a92:b102:0:b0:365:a65f:8008 with SMTP id t2-20020a92b102000000b00365a65f8008mr5920548ilh.18.1709128903398; Wed, 28 Feb 2024 06:01:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709128903; cv=pass; d=google.com; s=arc-20160816; b=Ue8Uqv+IECeE4MsIOJ60bPy48zpzbCgyElUpBxlYIGWu4/aNA5DglQUBtLlLIF0x24 V4TOoDxQFjYXwwyQGUivKR3ydLdop4UJ2L8GHiTufwCOmYZJD7YLSJtG9iB0pe2zuiE+ 3lVmEgIR9XaRNLXwDZ88puA19hw+SIaAF18rU+PtJkQIptMPMX9ka3MUHSQiwhle3oQ6 nPqM+mRo1wjJ2YG0LcWGxYfHYq/505Qth9QuP3r99n+NNmtsj7ynqjRiJdwhNtVAkyLY Udi/Xx4F3ALquuahsKMRLAFbVfvgjMw9RJgtxxhq/rvv1ws63T+tgmJi77zwUWFv11+J qORQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=8slQ0EEWDmI82JqvFmRvyFdisDEfhq5nXjWANd8L+vQ=; fh=pROKrtudychdWfX1/6j/Uq9afXUKMuzpYQEwL/mZsxw=; b=sD5YISpA7mWmIZqy4HmsdmykGYyP0xM9cr1j1pBpJjmRF1aGs3nPm/Ydn5gVafs32y i2a1tA9w0bcS50WE97X2HLwbV3puWxkW1Ky+lOqfnZLJ8lw7x3MkObKETmepnf/gYXUC glljfYDlWfNS/noz7+/zYdNXiBOHQ47chE8ywdBimETNnh9aBaxDkz6p+nDkmegxLSLP CMvg2y9jg1SY/j+9y6Rw7ICpT7a1/ZtjBN5x0mJ5rltPQqchtBtP5r6Jqvm4CDZx5mst BXeZWrLevXkZJ3Zw3OVG5SfrZ5f7iqcvUXcQiV+OBzXwIfEzcd7lk7VdAND8OgL+fYum q2dA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85146-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85146-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g15-20020a926b0f000000b003642d6a0874si2821279ilc.194.2024.02.28.06.01.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 06:01:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85146-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85146-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85146-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CDCD028ADCD for ; Wed, 28 Feb 2024 14:00:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B982A1586EF; Wed, 28 Feb 2024 14:00:24 +0000 (UTC) Received: from albert.telenet-ops.be (albert.telenet-ops.be [195.130.137.90]) (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 DFFCE150994 for ; Wed, 28 Feb 2024 14:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.90 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128824; cv=none; b=ShmYrJnJpO9+1iK4zt4AU7ruYBXWRUA0pr+yUrCE4Q4KOT5YhKkyzNNSUplRQMx7xIoycp0HjIAIp0lFJUnrVM6uoNa8NwXjw8eadAY3ojDl2/qOGzIcipoVRz7MkFE+D9WTeVx3xGwSSN3j+9lnIPIzs0RRyj6ToLao1EUdOGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128824; c=relaxed/simple; bh=D8NXY2ItVpwUES37gGIiU5wimOI8cGreVo83CtoNigw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WHMBh1Urbtd+dLmvqp/kF4AEw4I0hzrPSP41v/POv28iDsiQLzl5VWpFV1PxuWvBfDgURpGnp/se24pCFPZddOtiH4JEdORSg2YqnVu7M4TzP2neHlPtZKhyl1YGQeFL7II1YTAaoOlH2AEhcOD2SkrSpaLHMFH71si6Bw3hBjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.90 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:48c4:26a9:d9ec:22cb]) by albert.telenet-ops.be with bizsmtp id se072B0044gWvPH06e07Y7; Wed, 28 Feb 2024 15:00:13 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rfKTV-001tZG-EJ; Wed, 28 Feb 2024 15:00:07 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rfKTe-006hlI-Vc; Wed, 28 Feb 2024 15:00:06 +0100 From: Geert Uytterhoeven To: Chris Down , Petr Mladek , Greg Kroah-Hartman , Andy Shevchenko , Jessica Yu , Steven Rostedt , John Ogness , Sergey Senozhatsky , Jason Baron , Jim Cromie , Ilya Dryomov , Xiubo Li , Jeff Layton Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 4/4] ceph: Use no_printk() helper Date: Wed, 28 Feb 2024 15:00:05 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When printk-indexing is enabled, each printk() invocation emits a pi_entry structure. This is even true when the call is protected by an always-false check: while the actual code to print the message is optimized out by the compiler, the pi_entry structure is still emitted. Fix this by replacing "if (0) printk(...)" constructs by calls to the no_printk() helper. This reduces the size of an arm64 kernel with CONFIG_PRINTK_INDEX=y and CONFIG_CEPH_FS=y by ca. 4 KiB. Signed-off-by: Geert Uytterhoeven --- include/linux/ceph/ceph_debug.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/include/linux/ceph/ceph_debug.h b/include/linux/ceph/ceph_debug.h index 11a92a946016eab5..5f904591fa5f9e57 100644 --- a/include/linux/ceph/ceph_debug.h +++ b/include/linux/ceph/ceph_debug.h @@ -27,17 +27,13 @@ ##__VA_ARGS__) # else /* faux printk call just to see any compiler warnings. */ -# define dout(fmt, ...) do { \ - if (0) \ - printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ - } while (0) -# define doutc(client, fmt, ...) do { \ - if (0) \ - printk(KERN_DEBUG "[%pU %llu] " fmt, \ - &client->fsid, \ - client->monc.auth->global_id, \ - ##__VA_ARGS__); \ - } while (0) +# define dout(fmt, ...) \ + no_printk(KERN_DEBUG fmt, ##__VA_ARGS__) +# define doutc(client, fmt, ...) \ + no_printk(KERN_DEBUG "[%pU %llu] " fmt, \ + &client->fsid, \ + client->monc.auth->global_id, \ + ##__VA_ARGS__) # endif #else -- 2.34.1