Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1736726rwl; Thu, 5 Jan 2023 19:08:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtMcFtQElLLntDQwpefEF38XJjq10SDw7ulUnY27ubodITk5I1rfKbV/4ZfYBKPH5ZNUiM6 X-Received: by 2002:a17:906:d939:b0:84d:17af:2fee with SMTP id rn25-20020a170906d93900b0084d17af2feemr1261246ejb.50.1672974514220; Thu, 05 Jan 2023 19:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672974514; cv=none; d=google.com; s=arc-20160816; b=O8/FwPrfRoYhefBW4A2evrhgBUTC0iolT80A0DbhUtS4+HvK9CElMGSietaEkeEked 8XvEEuuG6jvueSC2W4vZuJO4O4tbcxbmwFy5WW6ju4nBgK/eFKuyWz6x+6YRIcwTRY7Z 08UxTt8qTRjAifwxoh61VPln6Pe7X9Qhw/sjIz4U//8atiSu7TAT68NsEAS62p4zgDnb aR7nDPYVGyaovt5MlsOV8/HdbeCxl5cr9symE8F++UFqorPtD0oEkuu5VECigcXai+wL 4rk6DSOTMqG8bAPIpePlExEUhOuUFxtDesWkoWfISLssNsmNdICSPk6FrVzYXoWE0iMi UrwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7NOBczeoke/3pHNqSzFL+Ra3q24X3q8LM4/Gy2IAsH8=; b=KRqFS1PrNLO5McESTIe4ThcpTzG41Jxj8FsKn6XOJ3XbztvT97EM8jWVcpmfboM9LD 5q1wvWAqvwF4xnmh3bPr2/V3sl3o0x6cr4UgX1SpZ9LkqcWWqkAhCvw4YMPu+9xlE6Ai SUFg7zIT48KWY2IbW6SgwdTduJKuliyTefXe+V9IoOs8gR3WNAWjpx6H6bdiQKu+YRgE MVFCqC2uZ1dcM5evmGUqlYWnt9rCZttHJ6KJQnk3dj/Pz5sDHAKKR/cBY0/wWqC//sf5 qWiiqpBab0m/RwOTCvB47N5t56g5nKd9GhxL3xfzns/MLKc8hQChPx27tHvogbAZlD5U 38VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=bz2w4rhz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk20-20020a1709077f9400b007be373ecc80si36540902ejc.16.2023.01.05.19.08.21; Thu, 05 Jan 2023 19:08:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=bz2w4rhz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbjAFC7W (ORCPT + 56 others); Thu, 5 Jan 2023 21:59:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231587AbjAFC7M (ORCPT ); Thu, 5 Jan 2023 21:59:12 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A31E534D6E; Thu, 5 Jan 2023 18:59:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3131661BE9; Fri, 6 Jan 2023 02:59:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D088C433D2; Fri, 6 Jan 2023 02:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1672973950; bh=9iIG1jjU+cVTa0DXtA/OdBSV7ZjX8LTbLAr0Q7d3PZE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bz2w4rhzobDqBZ+3D9oM3QCJuycDcgpASYh8SwLG6eDAMHrwgtlykxcUYfTZNa89D AQilsK0RNFrUl70fxFHUSBDmB4mR4PiUJ3Nr61ej0hz59AvWqMoLPdXQbcXFAEfnnv AJ3D4yZM1WVhHKgliO3uqnMA8s/Rwcxc10RGlHSA= Date: Thu, 5 Jan 2023 18:59:09 -0800 From: Andrew Morton To: Hongchen Zhang Cc: Alexander Viro , Kuniyuki Iwashima , Luis Chamberlain , David Howells , Christophe JAILLET , Randy Dunlap , Eric Dumazet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] pipe: use __pipe_{lock,unlock} instead of spinlock Message-Id: <20230105185909.c77ce4d136279ec46a204d61@linux-foundation.org> In-Reply-To: <20230103063303.23345-1-zhanghongchen@loongson.cn> References: <20230103063303.23345-1-zhanghongchen@loongson.cn> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Tue, 3 Jan 2023 14:33:03 +0800 Hongchen Zhang wrote: > Use spinlock in pipe_read/write cost too much time,IMO > pipe->{head,tail} can be protected by __pipe_{lock,unlock}. > On the other hand, we can use __pipe_lock/unlock to protect the > pipe->head/tail in pipe_resize_ring and post_one_notification. Can you please test this with the test code in Linus's 0ddad21d3e99 and check that performance is good?