Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp572902ybm; Wed, 27 May 2020 02:41:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6vdk0e8YNoAlFOA8mmM3kJ1RJzlubT8vON9pMwdEQ3qzK7nVdH3GG1PspD9gwSDQ50y/h X-Received: by 2002:a17:906:2c08:: with SMTP id e8mr5055097ejh.385.1590572475347; Wed, 27 May 2020 02:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590572475; cv=none; d=google.com; s=arc-20160816; b=BF00pudtCqgl50m+9G1gfNDumE3BHldWGVlkC0hJBHO5HsLmlhqiO9x6fDKhBnIP6o HoFutuWqrDwCgjpFyARfzrai9gDQ43KF0wRa6Ca0rEgiQo/YQwmxvKCJp6yXPI9kAwsg JYBCaZ1pcoPVkUfENcPU636g7Dm5kQ2L2mQL6dSsHOAngSQhtQLiuQ+cKL7v/oGEtHOV MzQK43aXwJdL+ET0tmfGL7zb0s3OJn1mqRcF/r6bZS6POhRTKR1jEMahlrGV3Mogn8Qc CtdSEEZyPoGMVasLQ9h6kqzfSykNEuRldcpxB0pCgb2f8BIWG7MUzltVtIrBUsAfM8YA nXIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NHzMNH28y/GXSoFOf1/NF/R2VMPDvKZxUdmkO5KBgxY=; b=cq5jdajZj2nv9ZeUQI6QzjruCxLjfq06Kbk7ZOp2qUvbLwK/1LeGOfqzcn2tobhhbb Fdioa6zY17VVcA8Md8xlV2NU4OeJMQ5YhJQMdX5BB5lHPPV7aQyK9gtu9AjgWygfTPFt wASbk+k7f6G4as77kcNrrXSQjxw9IARjwYIAEzvbYPuCw+3A24uri9LxdCsv0r2JMtum yIVxgff7EVhXFQZ9WOVP0RWYhYQYybvUAzVPDS05dF/kRNRAJJM0niyvB/xXHRvRwde4 nqf43TYLfo4ARg+CRKZByMTL2ijsQ/VrKiGxwcudb7eW9muw8r78Ap/OPLpG9kIvvy6Y RCnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=jJTXjPkg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb11si1725473edb.302.2020.05.27.02.40.51; Wed, 27 May 2020 02:41:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=jJTXjPkg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728209AbgE0BOS (ORCPT + 99 others); Tue, 26 May 2020 21:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbgE0BOQ (ORCPT ); Tue, 26 May 2020 21:14:16 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002E2C03E979 for ; Tue, 26 May 2020 18:14:14 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id x12so17901377qts.9 for ; Tue, 26 May 2020 18:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=NHzMNH28y/GXSoFOf1/NF/R2VMPDvKZxUdmkO5KBgxY=; b=jJTXjPkgJLHrf2hO4j4PKGAsQ+OKm/7kMeoo0TXPZvOfXHeldzfY1lXSh+NwiaxTOw ZKnc3V5UK9RskJaNiNhRroqXlInFVKOAbJ9njNeGK1woyD/fhwy2Lh2BzGuO3QqBKS49 Y6UzSbGFQwu17utdr39lsGrhkGKF4xP4O6twY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NHzMNH28y/GXSoFOf1/NF/R2VMPDvKZxUdmkO5KBgxY=; b=EKGkWeoQocMDVit7lYsT7RE4yAedA2cN4SI8+cauD54VZidEkSPSaN4zic94ITTgxS ECm47azt2sLzW8MmldGTltQsTK6pDlwchVzVFRbNMXUdjQsgyUshi3a+RPixIQhL3OAc GJ06/y7IfDPzxpvQcDYIIcP4SzRuVdCO1Ko5J9tJVMZQnmMmYsxam0yDRAu4Bx6gxJGn sOVMxO56lZv2RmVft5UO/AjeUrhgPLXrswYBkbofBmSr4HqSXDo+5CMjDLa63btocSIG U+Qw+Eh3vq9fP3aHLe+iVvJ/VcxyOsRlKrUlhNZPFaqptthIzhNPfUGIoUUngxcrUkRU Cb7w== X-Gm-Message-State: AOAM533ZZivBPs5OnOlhX6K6WnVKmGqXoVfJqgfJrE0yS+7pMdw3iTFz Bjy9SbWsj5ltcK2umVNmU5S7aw== X-Received: by 2002:ac8:7b4c:: with SMTP id m12mr1627606qtu.97.1590542054136; Tue, 26 May 2020 18:14:14 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id o144sm1075774qke.126.2020.05.26.18.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 18:14:13 -0700 (PDT) Date: Tue, 26 May 2020 21:14:13 -0400 From: Joel Fernandes To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, "Paul E. McKenney" , linux-tip-commits@vger.kernel.org, x86 Subject: Re: [PATCH] rcu/performance: Fix kfree_perf_init() build warning on 32-bit kernels Message-ID: <20200527011413.GD149611@google.com> References: <158923078019.390.12609597570329519463.tip-bot2@tip-bot2> <20200526182744.GA3722128@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200526182744.GA3722128@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 08:27:44PM +0200, Ingo Molnar wrote: [...] > ./include/linux/kern_levels.h:5:18: warning: format ‘%lu’ expects argument > of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ > [-Wformat=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ | > ^~~~~~ > ./include/linux/kern_levels.h:9:20: note: in expansion of macro ‘KERN_SOH’ > 9 | #define KERN_ALERT KERN_SOH "1" /* action must be taken immediately */ > | ^~~~~~~~ > ./include/linux/printk.h:295:9: note: in expansion of macro ‘KERN_ALERT’ > 295 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) > | ^~~~~~~~~~ > kernel/rcu/rcuperf.c:726:2: note: in expansion of macro ‘pr_alert’ > 726 | pr_alert("kfree object size=%lu\n", kfree_mult * sizeof(struct kfree_obj)); > | ^~~~~~~~ > kernel/rcu/rcuperf.c:726:32: note: format string is defined here > 726 | pr_alert("kfree object size=%lu\n", kfree_mult * sizeof(struct kfree_obj)); > | ~~^ > | | > | long unsigned int > | %u > > > The reason for the warning is that both kfree_mult and sizeof() are > 'int' types on 32-bit kernels, while the format string expects a long. > > Instead of casting the type to long or tweaking the format string, the > most straightforward solution is to upgrade kfree_mult to a long. > Since this depends on CONFIG_RCU_PERF_TEST Thanks for fixing it. > BTW., could we please also rename this code from 'PERF_TEST'/'perf test' > to 'PERFORMANCE_TEST'/'performance test'? At first glance I always > mistakenly believe that it's somehow related to perf, while it isn't. =B-) Would it be better to call it 'RCUPERF_TEST' instead of the 'RCU_PERFORMANCE_TEST' you are proposing? I feel the word 'PERFORMANCE' is too long. Also, 'rcuperf test' instead of the 'rcu performance test' you are proposing. I am Ok with doing it however you and Paul want it though, let me know. Paul, should I send you a renaming patch for the new performance tests as well (which I believe should be in the -dev branch). thanks, - Joel > > Thanks, > > Ingo > > Signed-off-by: Ingo Molnar > > kernel/rcu/rcuperf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c > index 16dd1e6b7c09..221a0a3810e4 100644 > --- a/kernel/rcu/rcuperf.c > +++ b/kernel/rcu/rcuperf.c > @@ -88,7 +88,7 @@ torture_param(bool, shutdown, RCUPERF_SHUTDOWN, > torture_param(int, verbose, 1, "Enable verbose debugging printk()s"); > torture_param(int, writer_holdoff, 0, "Holdoff (us) between GPs, zero to disable"); > torture_param(int, kfree_rcu_test, 0, "Do we run a kfree_rcu() perf test?"); > -torture_param(int, kfree_mult, 1, "Multiple of kfree_obj size to allocate."); > +torture_param(long, kfree_mult, 1, "Multiple of kfree_obj size to allocate."); > > static char *perf_type = "rcu"; > module_param(perf_type, charp, 0444);