Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3178788imm; Tue, 4 Sep 2018 17:21:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaFyqzKFAcUwt+Xq7XdfnBDoY4jgmRbDQMFOhKm8nPGjVitYTizp2r9a4lelzjdS4p4qOQy X-Received: by 2002:a63:bc0a:: with SMTP id q10-v6mr18856933pge.60.1536106907392; Tue, 04 Sep 2018 17:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536106907; cv=none; d=google.com; s=arc-20160816; b=DsjmTcKhneaxjpMrFosgfQ7YY7vyCMolJxIRmbmdxo7NGB77DUcKg3s6ppUfzqPF73 5k/3mfGsBnhnuDt26U/4g3h0SogDL2jdRt4fKSAyAufT8EDWTGgxrYixeM7YI/r5qOIc KT74GiTvet4+xnC4uYWp/eiqhSpQKxtym9cYdZ7LvATTEpUOSv/FY8UvUj08JS99mhKe wtYg9IwxmoPo1SZau03uQJ5mWh9xONBqXnBNjoqFSMt7j9g3qcbMMwZ+wDaWOMcsBv3r nqvFzRvRZVUpgdUjQwtGay2agdfYcP8L3hBqDODz47IRIu/FkFNnoAyYC9dHtDvFQNDa QD3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=zETsxMgmNx/pNcrNmXJfFYb5H053QfEH1iv5O+mkN1c=; b=hVcW4UEm2EtWcmgUNE+nLoruKvUPfJ27L9zehsjZElYMZZGolttR6tozPQpNy8vfVW MOeQmzo6uqRMQ4493nddiJv0NTq68xInRa18y7/2GR6ACIJ/ZSpS0U4pq6GFtJOQ0u8F cmjlpmSy+dsCJjXkhhlQI9obhcxJgEbnQ8XvRurMIrN0KdvS5RurpUxkfPP3N3ZEAOqi RXEP5MfdMW9BM0mdWzpXjyrgvW/6kGxABgmxiEj67yY05CZI9s/t33ys3LJy2Iaz3ceZ iIjIGV0GAZSgYzUyBakT+SWdMat/23FRHzz1jom07rTg+uI87i7oyBx+Uac5EgmPYgE5 /Y8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=bWkRpIye; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si307107pfn.85.2018.09.04.17.21.31; Tue, 04 Sep 2018 17:21:47 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=bWkRpIye; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbeIEEr5 (ORCPT + 99 others); Wed, 5 Sep 2018 00:47:57 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:40844 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbeIEEr5 (ORCPT ); Wed, 5 Sep 2018 00:47:57 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w850IhRW142516; Wed, 5 Sep 2018 00:19:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=zETsxMgmNx/pNcrNmXJfFYb5H053QfEH1iv5O+mkN1c=; b=bWkRpIyeVgFrwmVSK/mCsq1kl2LklnnrA5ibHZIPf79ObDHWL+fVIUxPovR1+OnNO4Yv zhwaMQJzuVba/upB7v17py7ICbzhmpEKq9TLaMUkTatdf0ofWJ7U9mGw80GdHsAN48HC Dge0veVBFDnoD+s/wA9hB/01ZidnDQ8rTmc48+GlquXou4KdUAXx8eIfy/40NewxRP7i NgJuSBfhGnL3M9LYlLmjkpa1wGEGlmZI1sZqhZ7nT5lJFgAqYi9L7gQQdnvh/GI7Zh32 kaizlWdnw6MiJ5BYOcuE8QKBg7PVR6qdoCG66a4aa6zkEmoEcR5noiqvf500yTjdskFF MQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2m7kdqg83y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Sep 2018 00:19:59 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w850Jqf8007584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Sep 2018 00:19:52 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w850JpUJ016823; Wed, 5 Sep 2018 00:19:52 GMT Received: from [10.132.91.175] (/10.132.91.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Sep 2018 17:19:51 -0700 Subject: Re: [RFC PATCH 2/2] pipe: use pipe busy wait To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, dhaval.giani@oracle.com, steven.sistare@oracle.com References: <20180830202458.32579-1-subhra.mazumdar@oracle.com> <20180830202458.32579-3-subhra.mazumdar@oracle.com> From: Subhra Mazumdar Message-ID: Date: Tue, 4 Sep 2018 17:20:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9006 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=994 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809050002 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/04/2018 02:54 PM, Thomas Gleixner wrote: > 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. Makes sense. I will remove it. Thanks, Subhra > > Thanks, > > tglx >