From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C1FAC4338F for ; Fri, 20 Aug 2021 12:20:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A40B60FE8 for ; Fri, 20 Aug 2021 12:20:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9A40B60FE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=crudebyte.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH3Vb-0007QY-Is for qemu-devel@archiver.kernel.org; Fri, 20 Aug 2021 08:20:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH3Ue-0006Z7-If for qemu-devel@nongnu.org; Fri, 20 Aug 2021 08:19:28 -0400 Received: from kylie.crudebyte.com ([5.189.157.229]:60801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH3Uc-0000JQ-Kh for qemu-devel@nongnu.org; Fri, 20 Aug 2021 08:19:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=4VwW6/94IpLgIrPy0K3GzmQMfhOK1XuhFhZdE7qkkKQ=; b=VQSBDJnlLkwT6GPKaLzeT7ZUN0 iWEX6CItZNrqTAN5hXtdARet8gl1KY7PCUuML0BKgGGPN7RR9vF4tdHhBv2r/WskCRnRiZX+KHOgr tbEsQNID73Dk8LW46E+uPsu60PjOMfMOMH2O2yQPIXF5Ag8ksxq/qdIbPKaFLX9xriUM3kzcjK+Ly 6xxFP0WT4kbYE8DtEC4Hump3AOUFkCHwHXG31Wv4gNIU5YTq1k9vDdoF5mnMgCWf+vjanTeWU6kdP m/sP66mYVan8jPy1hwBm6yu6sxhsEqWp+gkAk0r5Q/ob8RqQkStt3tcS1FKTlOYn4eredNFy0oMH1 V+wfn0wEcPZFbMhlh5u7HSyESY9cN2c95AYJi8ErCtwWQ206UvgZ8oyOgJuIj1oWsZu6/ibPkiByE T7f2UHibbOtTpkSjZfU3V6X6+eJFp3a1OcCOjoSOqyQKD023Cvr3lAauwZmpmh4ym03OwbWtB4l6q GiB5o+xxzS2N0MXsvy0OI3xRqMz40bApZpVktuYQRsLl8v63rORbE6jwNDOsiae9K+XGsyc785o6B 3bSLUJaNRviIAgGZTKiizUUZ2/snwfF2lcC7jIqPh0v5PxR6To8f+1HEFMlof59F3fik44W9nlD0p GUuCmTTLKWKRdNlogHjh6pXSKK8DT1eFV40YUYgWw=; From: Christian Schoenebeck To: qemu-devel@nongnu.org Cc: Greg Kurz Subject: Re: [PATCH 1/2] hw/9pfs: avoid 'path' copy in v9fs_walk() Date: Fri, 20 Aug 2021 14:19:21 +0200 Message-ID: <11476815.tdmo6TZaKc@silver> In-Reply-To: <20210820123549.4d5b353f@bahia.lan> References: <7dacbecf25b2c9b4a0ce12d689a8a535f09a31e3.1629208359.git.qemu_oss@crudebyte.com> <20210820123549.4d5b353f@bahia.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: pass client-ip=5.189.157.229; envelope-from=qemu_oss@crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Freitag, 20. August 2021 12:35:49 CEST Greg Kurz wrote: > On Tue, 17 Aug 2021 14:38:24 +0200 > > Christian Schoenebeck wrote: > > The v9fs_walk() function resolves all client submitted path nodes to the > > local 'pathes' array. Using a separate string scalar variable 'path' > > inside the background worker thread loop and copying that local 'path' > > string scalar variable subsequently to the 'pathes' array (at the end of > > each loop iteration) is not necessary. > > > > Instead simply resolve each path directly to the 'pathes' array and > > don't use the string scalar variable 'path' inside the fs worker thread > > loop at all. > > > > The only advantage of the 'path' scalar was that in case of an error > > the respective 'pathes' element would not be filled. Right now this is > > not an issue as the v9fs_walk() function returns as soon as any error > > occurs. > > > > Suggested-by: Greg Kurz > > Signed-off-by: Christian Schoenebeck > > --- > > Reviewed-by: Greg Kurz > > With this change, the path variable is no longer used at all in the > first loop. Correct. > I see at least an extra possible cleanup : don't set > path before the first loop since it gets reset before the second > one. Also correct. > Maybe we can even get rid of path all the way ? I'll have > a look. Yes, that's the plan. There is still quite a bunch that can be cleaned up in that function. I just didn't want to start with a two-digit patch set right after the long summer break. ;-) If you want to send some cleanup patches, always appreciated. Best regards, Christian Schoenebeck