From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 68D083895FCC for ; Thu, 15 Dec 2022 15:58:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 68D083895FCC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1322d768ba7so21473685fac.5 for ; Thu, 15 Dec 2022 07:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WT0RBEMMiI+nqYwZKIJj4iWi+gPY3Z/RozPKUSr7tR8=; b=bYaGpgFZMmXO+1Uf44rZP5Wi6v8cfhc/PzmKjEz5n6Eg7JFdwz1KP5crli3JEau5Pn U3KlfLiAuxlB4kAjFPwNlngaJqd/eHFS2Z+NB1tgKRXFGV3l3sQZqXAtc5s6KBHzPT9N AELD/CbjRg12bIaFyjC6sYomcagOSI8dMWAS7oOPStHwlmvojnk+LrpnG1DtUlCGBPiU pf1B73NvOcwFA/BhaGabGzvODPbOV7lpYyXOwtitetwpWcoUy5Lz5gV6u6I8PGQN5PCh ulghwJreoGepotMwB2Ih/j9B09BYbAtr5wyiLneOHjX/j2HnMbkTKyZNF8pX+QdocAgY lOfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WT0RBEMMiI+nqYwZKIJj4iWi+gPY3Z/RozPKUSr7tR8=; b=1Q3rxzJf+pbeqz/6jEaurVA4hQXOXYDKFKIK9yCNbCfyJtAHKGK+60nQ9cLuMUQ/Ic Jbd/mXaS75k/7WiZDaFg+Tm2np2jLb4oVnj1T+RWcrRmDl3UWVO1Vqiu/wz2GS8tZOkt DTCPx1+THj/ThAX7twK47qQzcaw23qeMpLgBpmhFo/IIz9G+5/O42AfS+ZHWC6UiEiQ6 a6QaBh9GSAEXLuh+iT0cq8Da7KOLbZvo8ZVaCMbue0OFZMjP4hQDnfvjZWOlc37MDJby RvPzJ1V8BV0tWhepT4y/qsVKlAonYmvQqbtj7wb74jFqndIz+JvHjod/1Gcs7IjtDZlt /sHA== X-Gm-Message-State: ANoB5pkeWS3ccQA30EXwWb2zbcVYzMBDAufmFMC8JQQB5slwHI+oKX16 z4ISXesQo0R9eY5GqucULAIz05OsboFlRmE8xJ4= X-Google-Smtp-Source: AA0mqf4CbYqVbDqU/sZpuU/YLNbmTKrxC1HBIVZJ0TExwV9xOC0ph8acvV4aV+z5vQ1vGOx9G7QA8Q== X-Received: by 2002:a05:6870:5ba3:b0:148:41a7:eb35 with SMTP id em35-20020a0568705ba300b0014841a7eb35mr10513333oab.12.1671119909302; Thu, 15 Dec 2022 07:58:29 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c2:f05e:14ba:6503:a761:d926? ([2804:1b3:a7c2:f05e:14ba:6503:a761:d926]) by smtp.gmail.com with ESMTPSA id z36-20020a056870d6a400b0010c727a3c79sm4139498oap.26.2022.12.15.07.58.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Dec 2022 07:58:28 -0800 (PST) Message-ID: <66994c3a-3859-a180-ee75-162c20b6bfeb@linaro.org> Date: Thu, 15 Dec 2022 12:58:25 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v5 06/11] stdio-common: Add lock optimization to vfprintf and vfwprintf Content-Language: en-US To: Florian Weimer , libc-alpha@sourceware.org References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/12/22 12:23, Florian Weimer via Libc-alpha wrote: > After the rewrite and the implicit unbuffered streams handling, this > is very straightforward to add. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > stdio-common/vfprintf-internal.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/stdio-common/vfprintf-internal.c b/stdio-common/vfprintf-internal.c > index 83a6aea510..23ada8d0ff 100644 > --- a/stdio-common/vfprintf-internal.c > +++ b/stdio-common/vfprintf-internal.c > @@ -1452,6 +1452,14 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap, unsigned int mode_flags) > return EOF; > #endif > > + if (!_IO_need_lock (s)) > + { > + struct Xprintf (buffer_to_file) wrap; > + Xprintf (buffer_to_file_init) (&wrap, s); > + Xprintf_buffer (&wrap.base, format, ap, mode_flags); > + return Xprintf (buffer_to_file_done) (&wrap); > + } > + > int done; > > /* Lock stream. */