Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1349862ybz; Wed, 29 Apr 2020 20:27:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLIW14T8T+mCQ9myl7CsXxog8RBsw74JcoPCuBYZuWXSd9P+Nq+ZvFqvbqQ6SxZrmrmHsuJ X-Received: by 2002:aa7:c497:: with SMTP id m23mr857183edq.155.1588217265116; Wed, 29 Apr 2020 20:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588217265; cv=none; d=google.com; s=arc-20160816; b=GabKTJTFhYwGhZsRllcmjiGqSsYPUKph8fhhDlSbY7FRjreE3IV6vGhivtH9OZN2nO eAWxxzVXvYfeBxIqqqJHPMhQvphwSoUkuBYQzcblE2PP2vmxaPIddNe5l4oWDyF7vJ2Y peSSjYfvY/1toSdD3EGoEXrdB6/qEl6nbhM69Jc1XftDHLBgntvBaBS8b1Z16zjtRjLV gGYpZ2Cd1ixJpkcozntQGncfrConpwuQWlISej5DOqhqIP6QMZgKRsHKcKwpydgrWRlD faVlnNKWri9HHeDS0/G8YuCAgiQVc3j4Xey1za/FIZw4lPS9i1mTR9fz6j+1MTl7SwQ7 9ApA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=9+gJv1puRzCeSU6kM9ZR0dmtTOJ2hHKwfUKB2sdpjKc=; b=HpM8fFhAKQ9WL+rzFSBdTL0Mh1XkG56oT2oDJiaUJWzY8PYeCa31JVZphjjyM3xS+K oyJd//aGSWI3WJRYtkD2JmIfKPlSPOn0rnYD3Mogw5iv30vNh6nlIbqVosfgS7P2QqDT vxLhWg5H+GB/O9y7jaFy4fuCMPcK1KPvywVFuildNO9eqS61LpVQeLHiP7cFYxntnS2M IBeDHI7nMMJSyhNvJxMDXRrChCS3H+kFzUZVzL1Rb9z1/P1Qft1Ta99L7NkjUMwnZ8qi U9gqtijyRUBVI98Y42lqfPQuYldnYNvgvsO6GBY3ybWucq/aF0tsLDHKxjhWHa0BBb3u YS7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si4753471edq.8.2020.04.29.20.27.22; Wed, 29 Apr 2020 20:27:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbgD3DXj (ORCPT + 99 others); Wed, 29 Apr 2020 23:23:39 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:58797 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726435AbgD3DXj (ORCPT ); Wed, 29 Apr 2020 23:23:39 -0400 X-IronPort-AV: E=Sophos;i="5.73,333,1583164800"; d="scan'208";a="90801342" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Apr 2020 11:23:37 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 9166650A996E; Thu, 30 Apr 2020 11:23:34 +0800 (CST) Received: from [10.167.220.84] (10.167.220.84) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Apr 2020 11:23:35 +0800 Subject: Re: [LTP] [PATCH v4 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag To: Linus Torvalds , Li Wang CC: LTP List , linux-kernel , David Howells References: <1587552329-21738-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> <1587552329-21738-3-git-send-email-xuyang2018.jy@cn.fujitsu.com> <662aa817-04ff-e924-6880-7c23fa1cfe31@cn.fujitsu.com> <3268f153-6730-708f-ed93-19ca4cf85fdd@cn.fujitsu.com> From: Yang Xu Message-ID: <36bd1e20-414b-ec24-f7e3-16ef7e2395d9@cn.fujitsu.com> Date: Thu, 30 Apr 2020 11:23:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) To G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) X-yoursite-MailScanner-ID: 9166650A996E.AB31D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus > On Sun, Apr 26, 2020 at 4:59 AM Li Wang wrote: >> >> From kernel code seems you are right. The pipe indeed takes use of PAGE_SIZE(ppc64le: 64kB) to split the writes data in the packetized mode (marked by O_DIRECT). But in the manual page, O_DIRECT indicates us the PIPE_BUF is the correct atomic unit. > > The manual is correct. > > PIPE_BUF is the size we _guarantee_ can be used atomically. > > The fact that in practice we do have bigger buffers on some platforms > is an implementation detail. > > Yes, that implementation detail can be visible, but basically any test > code that tries to test for "what if we use a bigger bug that > PIPE_BUF" is buggy. It's simply not guaranteed to work any more. > > O_DIRECT is kind of immaterial, except it's just one of those things > where the atomic size is slightly more visible. But basically, > packetized pipes with bigger packets than PIPE_BUF is random behavior. > It may work. It may not. Thanks for your explanation. I am more curious about the user scene of this flag. @Li, so how to design this test? In this test, we don't have complex scene to test this automic unit. Best Regards Yang Xu > > Linus > >