Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp740003rdb; Wed, 1 Nov 2023 00:42:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQBao1Ex6IktYL7QYYHzIUFguhCF8/m1dSo3JoEvALeZs1QX092MTy39oK7kY5xIImrB77 X-Received: by 2002:a05:6a20:4414:b0:180:7df:76a5 with SMTP id ce20-20020a056a20441400b0018007df76a5mr14820906pzb.55.1698824525011; Wed, 01 Nov 2023 00:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698824524; cv=none; d=google.com; s=arc-20160816; b=LKnXwwPso3BmTPxJTgru8YtMGmUTY0u8YlpQgBCHvem3+Ft5TPb+gLS17ML8SVw/9J Vz3gjUMP7V66Em57V0TMzZeYrgBZFwifQ3toVwB6nno9g/XWWRST7eV+ppNJNnFrimxq FSqK30kpIjODmS5mnUkJUp4tr0g1TmxoCF/9mTCrjIrVxBddbOt+jWOW/i9QKm2XYSD4 lPsHilDNWYjJMFB80QMPnMbZ6dRXxS4Ei+UcJpzvgRSujPduw29aStGNmhUjKNjQCHcP l7uu9f0lHThOtpjZvxMu86v9qHfCvTYfLr2RTWmZKuGS6BivXsw2z32EXBekOUv/pJd5 LJPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=W0JdcYadX1Uj/95T3fXcyVaHAA0+IQtzR59DL7bY2cg=; fh=Q8c/L2bWDnwuq0Mc69f4aCxY7JqxHszLWiskFh3Nt1k=; b=h26GPkYI7xNEUxeU2JzxM3nrgmaLEs5uFgVut9DPoR56uwlrHbBU2MiHzsR94T0NYX FJeKafz5fciFr8qVv/BRZ9pNG3EEoXAomY4J2rYpG1YrqRqzb6knkuqbrelNI72jDUH8 DJHLm8GWIIfvPY9zSv6Z2JS9J8IXGk5HxOTeIxDcRepqMU2yeGheerAwsz5TGnLfvhWU AW2eKtYhboSxczeFEOWTbUSOy/fgD1OMHSa+OQZdvdKDT+FldlnLxICfEaQkoiUY503r 6ZgYTnFtYYscYE/WYPvkMAmH50wEr0yefyxqLXqZMaQ55q0Vgb1rojKdQ2Px0ib52oiN Q4ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=k05IFa8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id mj21-20020a17090b369500b00263eb5054f2si281350pjb.105.2023.11.01.00.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=k05IFa8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 60A65807C57C; Wed, 1 Nov 2023 00:42:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231502AbjKAHlt (ORCPT + 99 others); Wed, 1 Nov 2023 03:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbjKAHlr (ORCPT ); Wed, 1 Nov 2023 03:41:47 -0400 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBEF2ED for ; Wed, 1 Nov 2023 00:41:44 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id y5rAqxjn51jHcy5rAqb1Lk; Wed, 01 Nov 2023 08:41:43 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698824503; bh=W0JdcYadX1Uj/95T3fXcyVaHAA0+IQtzR59DL7bY2cg=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=k05IFa8GzXylwHKRm10nhBZrgD7pVppqAA7dozugSEw0Fy+64nxdUFNGBCOXE9MVM fa6D/XqpE2vvTEtMUs8821cAnm1QP0K6Vw7ns9Naih7xVsoN+YAygefGd6CExXUTlN Py7BKtTktPAF+9X+Qab78w2BNEUH1d76TfhGxGW60ubrsuqRCN+TyWi/xwquuSdK9s 7G7lOyLXOWWQkXeqI+U6OdduGHER7avOFjXT1brQvNRTPyqzBN/pOjqHzWe4bOG1Q5 TTUWZ3OVcOPTesfZLtw1fSCDSISILZLqFhaEntd+01EGHmsZT1e0LZexXbtCprNi14 OEecP7VhLj3Pw== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 01 Nov 2023 08:41:43 +0100 X-ME-IP: 86.243.2.178 Message-ID: <37ab9219-a049-4a43-b555-83b1629e5a48@wanadoo.fr> Date: Wed, 1 Nov 2023 08:41:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] refscale: Optimize process_durations() To: paulmck@kernel.org 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 References: Content-Language: fr, en-US From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Wed, 01 Nov 2023 00:42:02 -0700 (PDT) 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. > > Thanx, Paul > Ouch! 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. CJ [1]: https://lore.kernel.org/all/202310241629.0A4206316F@keescook/