Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp804327rdb; Wed, 1 Nov 2023 03:24:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLj5EZgGq2QLan5z14eBeFSib3QkKtHY202ZmmJyqqfCD3A8jKvyzVCi+BFN8u93QQYGBX X-Received: by 2002:a05:6a00:1488:b0:6bb:8982:411c with SMTP id v8-20020a056a00148800b006bb8982411cmr15717501pfu.8.1698834284706; Wed, 01 Nov 2023 03:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698834284; cv=none; d=google.com; s=arc-20160816; b=aKHx/BmEG1FacQUhs9WJpQQpeXjf4xX1i4xDSIRdDYPSyqFvcfIx/UVj8Pdm/nSAML EGHYkeyvT7n4qmkKgVoiu8MQcEU99/2Qxgl/zsnrftihzLSpBP3s2hpWWf4OqUS4tgp4 yH1OHCAalATxxXtUH1LyazHrfNImQ7NN/qICUCq2qwV86TiOKIG1pdHFqzM1wnOIT6oN oW/bD6X/X8Z85Kl+3MV262zWEiQCJgUUbYBY4+vmrn4uGuQaSBsdmJC06yR00Txi0+jV FVDZB5Z/I+GJjUwJQVU5YI/szzdn4kEmrncXGCSFQd0IM/2DsDJcBfEXgByWUQ/yWq03 XM9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=GfWKb79v65HKxCRI2ILQkmoKVUZt4NJOr8Jqt+VPJ+Q=; fh=ucXepX6kIrhID6W16oDHnP5BRXx5wJXvyw2a9sitovU=; b=nWg49lw4IQ+AfWWAc+LX7grJgg4srkeKOnvnqq1tnq52qpb8Xn5ykUlYuDeQg+R+dl 3eziP87frAI3AiXzyyOSxRJE6w3nelJFgKWPfCm/3A47vpdE5DCuM1yyTC4vqwWGiE/n 1oJiCXs0e+pgVaWJSKgWJTzhXqSLporL3gw3bCWVJuv/HcgIQdjTfbowqPV6aje3S53v afzIRzCz89ulpEhb3FxnnDfXpT1+b+evALXU51LqgFU5ui8RWaLw4GDGHu8EWvXc2MUr Cjw9yYcaat9xwbRy8coBbIqSfK+IvjH7WMPXadQwiLWj10yleJ7dGqmOLW2rdOJ3BRT0 TjcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bzVf4mZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fa24-20020a056a002d1800b00690d42e3347si1355253pfb.157.2023.11.01.03.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 03:24:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bzVf4mZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 42925804E699; Wed, 1 Nov 2023 03:24:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235069AbjKAKYl (ORCPT + 99 others); Wed, 1 Nov 2023 06:24:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234867AbjKAKYj (ORCPT ); Wed, 1 Nov 2023 06:24:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD8E10A; Wed, 1 Nov 2023 03:24:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92531C433C7; Wed, 1 Nov 2023 10:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698834276; bh=RwpwGnocw6uZNsKYyHZSk+qs8oRJkl1AiuuR52/+UbE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=bzVf4mZK3OhUrBy3tKrxdZXEjVnrMKW8Uf0jHVhmd1ibzGKf006kFgN/Ydm9GaEAY yRo54G9eMZ0s5BpI5L8Z0vGSvDhOtCFQtEIlEm9vO7igrdjas9ivN/UkfCBl5DIoxq agDEdFID51CjV8ByCHfQzxvW39zr2MnLmNNRjefhWI20sLn2o7cxQuwYnzjcHhg7K0 dO7T3UCwjyqnGxCH3wjwwpagt/tBVzfXPFcJykroMtxhxq+VY9z+EHgAlyQWo+XmLQ 8wksKDwZLnFht6sV4eNMzqCsgPnRzBUYNmHNoRYGEiulRzV/u/xmAo7uI8HE7qed4s gHg2GEwe9JIjA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 25BDBCE0B77; Wed, 1 Nov 2023 03:24:36 -0700 (PDT) Date: Wed, 1 Nov 2023 03:24:36 -0700 From: "Paul E. McKenney" To: Christophe JAILLET Cc: Davidlohr Bueso , Josh Triplett , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, rcu@vger.kernel.org, Kees Cook Subject: Re: [PATCH] refscale: Optimize process_durations() Message-ID: <014c446a-23c4-40f9-9512-6869a9b02117@paulmck-laptop> Reply-To: paulmck@kernel.org References: <37ab9219-a049-4a43-b555-83b1629e5a48@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <37ab9219-a049-4a43-b555-83b1629e5a48@wanadoo.fr> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 03:24:43 -0700 (PDT) On Wed, Nov 01, 2023 at 08:41:39AM +0100, Christophe JAILLET wrote: > Le 31/10/2023 ? 23:47, Paul E. McKenney a ?crit?: > > On Tue, Oct 31, 2023 at 11:21:14AM -0700, Paul E. McKenney wrote: > > > On Mon, Oct 30, 2023 at 09:55:16AM -0700, Davidlohr Bueso wrote: > > > > On Sat, 28 Oct 2023, Christophe JAILLET wrote: > > > > > > > > > process_durations() is not a hot path, but there is no good reason to > > > > > iterate over and over the data already in 'buf'. > > > > > > > > > > Using a seq_buf saves some useless strcat() and the need of a temp buffer. > > > > > Data is written directly at the correct place. > > > > > > > > Makes sense. > > > > > > > > Reviewed-by: Davidlohr Bueso > > > > > > Queued and pushed, thank you all! > > > > But an allmodconfig build complains about seq_buf_putc() being undefined, > > that is, not exported. I suspect that other seq_buf_*() functions in > > this patch might also be complained about. > > > > I am dropping this for the moment. Please make it pass an allmodconfig > > build so that I can pull it in again. Please see below for the commit. > > Ouch! Believe me, I know that feeling! ;-) > seq_buf_init(), seq_buf_terminate(), seq_buf_clear() are inlined functions > in a .h file, so shouldn't be a problem. > > seq_buf_printf() is exported, but seq_buf_putc() is not! > Really odd to me. > > Kees Cook (added in cc) suggests to use this API (see [1]) to avoid some > potential issues and ease the management of NULL terminated strings in > buffers. (#LinuxHardening). > > I'll propose to add the missing EXPORT_SYMBOL_GPL. Very good, looking forward to seeing the result. Thanx, Paul > CJ > > [1]: https://lore.kernel.org/all/202310241629.0A4206316F@keescook/ >