Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3065200imm; Tue, 4 Sep 2018 14:56:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb86FNR6Zq/w8zwaneO01fh0f6dyIYlg5KG/Z2lfYdM52wsFR2191/6/hOhOabX0mB7LtIy X-Received: by 2002:a62:45d2:: with SMTP id n79-v6mr36975179pfi.137.1536098190591; Tue, 04 Sep 2018 14:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536098190; cv=none; d=google.com; s=arc-20160816; b=dZB6AAZxx4nJfxvTcESnAFSuIuZd6SvBqfGOTzCT2/AYpHzGwjPc5ieY81+sfi7rxj jhZmNHmvPcMyknnhsjlQOiO9SjYCYxtlj6OhgtY6g5yckHg+mEKEnRgKFhcai5eJLKBA ewKVfvN02jEh2grLok94/84rIoMNS07/eaS6ciaShn6RaJhrKxuoV+HBgAE6XKHkR54x 7YTTkeFraNB1w+vxENMuimcM2mNrpUTCRyCnFM+3NGCKbYALNqQK9lzpNr+cvzdflwbo OlqA/F5N/KL8wzPkLh2Lm9ITCupYMdid6iXMmRQAc/1QU98JEpM5dLLcGwnNON7CSjCW beiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=2pmz6OuYvzbK7jWY2DGTlO+d5OQS9/A+5+/dTovTvP8=; b=aiWlUPWnLGaP9F2Mim/rFTSfv4AZFsKIynWHfd9SZdQ+x2UmfEpbcYEITNWdyzegMY osgvPXP1rlNM1lQAn4yF4iNw6/uFfxmbUMY9S5eqUPPqyWkR+tNp6gqrYaWWxPhdYchj ioLGyRROPtWUTDs9BUmTW1CUj/TdNRK0E3BRLQ5SDSLWuSqW8mcv6XaVQZk2KEjsiE/H FSr4LXbh0sc4lSdhbz9sMepirnhYvfnX/GaY+7h6dwslUOcEzl1Zu3mrMDSWWjTnPoTo Vx+wGZjrstX9rWTfI8l7G2o4vtCSftOzhGhm8b2KqlyC2FPCOEtsZnOsYgDkD244T+2K A5zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18-v6si21872504pgi.300.2018.09.04.14.56.14; Tue, 04 Sep 2018 14:56:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727330AbeIECWI (ORCPT + 99 others); Tue, 4 Sep 2018 22:22:08 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58020 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbeIECWI (ORCPT ); Tue, 4 Sep 2018 22:22:08 -0400 Received: from p4fea45ac.dip0.t-ipconnect.de ([79.234.69.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fxJHr-00069U-CS; Tue, 04 Sep 2018 23:55:03 +0200 Date: Tue, 4 Sep 2018 23:54:59 +0200 (CEST) From: Thomas Gleixner To: subhra mazumdar cc: linux-kernel@vger.kernel.org, peterz@infradead.org, dhaval.giani@oracle.com, steven.sistare@oracle.com Subject: Re: [RFC PATCH 2/2] pipe: use pipe busy wait In-Reply-To: <20180830202458.32579-3-subhra.mazumdar@oracle.com> Message-ID: References: <20180830202458.32579-1-subhra.mazumdar@oracle.com> <20180830202458.32579-3-subhra.mazumdar@oracle.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Aug 2018, subhra mazumdar wrote: > > +void pipe_busy_wait(struct pipe_inode_info *pipe) > +{ > + unsigned long wait_flag = pipe->pipe_wait_flag; > + unsigned long start_time = pipe_busy_loop_current_time(); > + > + pipe_unlock(pipe); > + preempt_disable(); > + for (;;) { > + if (pipe->pipe_wait_flag > wait_flag) { > + preempt_enable(); > + pipe_lock(pipe); > + return; > + } > + if (pipe_busy_loop_timeout(pipe, start_time)) > + break; > + cpu_relax(); > + } > + preempt_enable(); You are not really serious about busy looping with preemption disabled? That's just wrong. Why do you want to block others from getting on the CPU if there is nothing in the pipe? There is no point in doing so, really. If the wait loop is preempted because there is more important work to do, then it will come back and either see new data, or leave due to wait time reached. Thanks, tglx