Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp927846rwr; Thu, 4 May 2023 11:27:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Wlfje2DanO0+kA2M72urTS1cBkBnnWpUo+gtbbM6uIfbHzguwP3g3FJRv3CN95opKuUcB X-Received: by 2002:a05:6a00:1a8d:b0:63d:6744:8cae with SMTP id e13-20020a056a001a8d00b0063d67448caemr3084726pfv.2.1683224826147; Thu, 04 May 2023 11:27:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683224826; cv=pass; d=google.com; s=arc-20160816; b=dqFjSfpRE5EJRMT8I3k7kqYJ7I/Qm15ry1XEfASPnnL0tGUX6vuw1U70/e+2S0iluw 3oBdaO8ocqh8jQkBPA+76Er/z929gg1g4F+xrhUmYMWGYOSD+MeRPLcHCJfFzbVbwqdg sH8ga81eq8M/gbVk8eUGtYsqC/OlxUlrKd4OXR4zYNfNmvDXomh59GmbHmnF+uLVKZZe dAU/cOzPuTZ0D8hLoRCoB9bwDVY6zJLvGmvMl/HHInBZmZq2/SPzNfe3SSfZMB0/gPM8 xjpGf/EOVJYfXAC/1F5m+5XTfQwhMYE8Oou5WJMLe1iuH5BrAHXMkToySpN6w37tURzI FVSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:organization:from:content-language:references:cc:to :subject:user-agent:date:message-id:dkim-signature:dkim-signature; bh=WMDHsjcLPe6GWiTmqFYf/ioNx83pizHCO9xh4cYqW6I=; b=HUtbjqPlRPOsgLCsmhbhFD8p6S2G1XFBlMVivlYkviTeOIQwIRgjfGdyqrRCD6ffwY oypDuJD2DMn+z5Xxqlmvi2RiP+/FR0m+d+iQRUWZbS8VROU2uLDaoHDwD9G4xgJzZBFc +AEvhjTK9Ph/VCOhpD/Mcd+IkIvMYQtUXI+ROIM5jXgcXplLVZ/4ezEwzLmOXmhyNQ93 xF8LPwECSP0Nz4LwtbR025ajvHMi8cfb4c/nL1cUVRfIOuqugzzY+fq/nIcurItPCX5M 0rBJTFSry4vqdt3teaV/8YzwbVsqcvVCVgzeGNX0Ai3NdpuZ4q5htx5QEl+1kj6PZsYF F/4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=n0FhvZug; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=JbT7LC4V; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j18-20020a633c12000000b00525049b622csi68585pga.71.2023.05.04.11.26.51; Thu, 04 May 2023 11:27:06 -0700 (PDT) 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=@oracle.com header.s=corp-2023-03-30 header.b=n0FhvZug; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=JbT7LC4V; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbjEDSSf (ORCPT + 99 others); Thu, 4 May 2023 14:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjEDSSc (ORCPT ); Thu, 4 May 2023 14:18:32 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106DAE4E; Thu, 4 May 2023 11:18:31 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 344Fs2ar024876; Thu, 4 May 2023 18:14:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=WMDHsjcLPe6GWiTmqFYf/ioNx83pizHCO9xh4cYqW6I=; b=n0FhvZugokb9aSBctRfgLi/l07ugWZwi95nb0D8SvwMkHMPYqqeSxeJh01rGluTOuaRX mI2ZYUkHe0TDcc14JLLkuhofkTtd8bHrJkGqY5wagAarv5HKNFw5ic0SKZBfYIl+4dtc gEWScZDZLwK1K2nMPYzKNGZP+SIVyVxPa3BbPZ1eltdjOZjb2S9/++PuVJpgJ96S8lkL nKlPGQbtQ7oN2pzQ2qU32apFCu0+8OxjE1uuAYXddOt9oJ+18PizXPKnMpFUU+QKYFV3 f5QBzPqlSVwWIwjySjEl70hrUo1VoBCOm9WmZq/NYRXGMvzxgCjmXqkN35ZVEs03P/y9 gQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q8su1tkm5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 May 2023 18:14:51 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 344GxlHL040517; Thu, 4 May 2023 18:14:50 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q8sp8w2mp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 May 2023 18:14:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CuZ1SF9OGtn/wyT3n0yiuZZzRf5Wrw72MkJm+RiIjh1ruqN9TXNi67DoznMnaBG/B5dw7nJi/d9IQHN4aRtTYQ20No7QFbD1vF4ZCg9Jh1KS9y1jtkqWVtDGBeJRqjXmE3vTSZPDzPtWND7wOEDtcTHfrMc1xnGsOdHEb/e5KJ9jiKC+eOt659w04ct/Bz1ZQWpcK+3oVenqA+vBDZEXHo3iVer8241nyxFrypkKgBMLJzrgU2j8GAlVi5D6+CXGSHaYTpfO+PUOMYdkfFS97N01yyI8AHSddD94iwtASQZR5nJQDK636fKBbzaFE3RQP0I6p8tVK1R3LKpWFp6jZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WMDHsjcLPe6GWiTmqFYf/ioNx83pizHCO9xh4cYqW6I=; b=J6XWVLbJbDox5qhPQBgu5m4oqUgzMSDEgTDGmj++CMVm8VmJKvpY9AGoxRVGOM/LBhp/61RW7PBwC/cc3lER9KgcIPEGgsK7JwjFyp6hEQNcGFGNCIubj5F+lBsmnKcy196ZO7qytFsdhb5OmYM5f60RZ+yECKThewgKiNAv7lLEwnpoESjO0Xxg29ozRU5+czzGd0NA3Dkcn9m+n0fh2v+AfoXIrB1CGXHVUPiLyYDjb9JQQmXBTp2jRKICzbr+tD/njtfq6YVoFJ5FRjc8doX1PGYkRDQT7AX25aBUIk8M38M36CvXm3fCBIJzGuuR6irU22/WzNwU3IU2GEFpVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WMDHsjcLPe6GWiTmqFYf/ioNx83pizHCO9xh4cYqW6I=; b=JbT7LC4Ve5u/ssClKwb11/zLKxL+b1cFIrbEM3LphSnqHkYSvSVisAbUtSgVGXCg9FMuTr/1pU6dnAAj5FVVx+pN0//6UxyLgHKnha84+pKTaL7LTjuRyL+V5s3djri0Sl4qlHaykAosofl/32k4Fvmv4TE9PSWkXq1fYeXFYc4= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH0PR10MB4758.namprd10.prod.outlook.com (2603:10b6:510:3c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26; Thu, 4 May 2023 18:14:47 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::8456:ba59:80ec:d804]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::8456:ba59:80ec:d804%7]) with mapi id 15.20.6363.026; Thu, 4 May 2023 18:14:47 +0000 Message-ID: Date: Thu, 4 May 2023 19:14:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH RFC 01/16] block: Add atomic write operations to request_queue limits To: Dave Chinner Cc: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jejb@linux.ibm.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, Himanshu Madhani References: <20230503183821.1473305-1-john.g.garry@oracle.com> <20230503183821.1473305-2-john.g.garry@oracle.com> <20230503213925.GD3223426@dread.disaster.area> Content-Language: en-US From: John Garry Organization: Oracle Corporation In-Reply-To: <20230503213925.GD3223426@dread.disaster.area> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI2PR01CA0020.apcprd01.prod.exchangelabs.com (2603:1096:4:192::6) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH0PR10MB4758:EE_ X-MS-Office365-Filtering-Correlation-Id: f898cc03-bd19-471d-788f-08db4ccb715c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sgPB1I50u7QGdxg+FAlyX/EaXYsehvUd9kFlyfjb/fS9nAWExYAEvtC8qO00aLSU1QWKXlY61g/Z1jiIobKfv8EEUa711yjpIUKdsaNHkjheccT7/EPjBWryU0Zpi3INB/8eVIDncxFKPq/x9oZwRTA1UcESCCeXYvLskF4y7/il2goACWSL2D6837GlqDES39VshuY8bXVkUuL+RgMKkSBhPrSEbA54gMkUysTsymg8XKqj+SAf/hDxSou7fBkTwYeD9bYsX4VNtCuwNcMi2K/kAvtYXEhgVUXOXhmBY5aeAELY6HVS+hakWj4LtHgEo0ZTfj7KyNCAp2HlwSQ8RFvVKwzpAOOk+fOPpUsMDY5WSOzxysgtUgL1tOrFNnRkXWh/lj1E7n5Pi8UcOFIrd2G/KYJOFRlbdTSh+urBF8SNTLwmrvEOWJjl3YQNlwNxb9K0kBnYz76mGpeKkeE+E5JoqEMZBhWrpVhblo/wZxZ96gIU+5tKPH/KNf1uoctL6fv8UDTmpz2+bgv6nLgLtEZjCX9JnPvxppOtad6b7T+3SnxPSu5MF/DlERtolMrtGnD2gjKPwS+pDKQ2hmG2bKYYxSmtMZoEN8FhYtfaN0eo+jUNAYCBHa+l4VqU+YHt2JTyvktKU/g1h80crVinPA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(136003)(39860400002)(366004)(346002)(451199021)(478600001)(2616005)(6486002)(86362001)(36916002)(31696002)(6666004)(41300700001)(316002)(5660300002)(7416002)(8676002)(8936002)(38100700002)(107886003)(66946007)(83380400001)(36756003)(4326008)(6916009)(66556008)(66476007)(2906002)(186003)(31686004)(6506007)(6512007)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QWhjUnpsRWh4czBwMStQT2NkdkR2dlhobkRQZWd2RGpVenI0eDRObUVnWThO?= =?utf-8?B?blZmVUJibmgyMTNhOWpUZi9QZVhxUDFMaXRsdkRRa1dCYW5DRmpLd0xSdzBK?= =?utf-8?B?UzF0Qk1QK29BZTBwMkJCWUhaNG1MYkkxeWhzZGdpRjFyem1HeDU4QUU3YkZC?= =?utf-8?B?U1ExQitOZ05LUmdkRlpUeElnK2RqL0ZJS0hRa1JDbWtUaCtreVJYMmVtK05l?= =?ut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SzI1UnExdWJHWDNUYXByK1dSQjA0?= =?utf-8?Q?pTkE4kytA8uZMcOSWCc+UPcJc=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f898cc03-bd19-471d-788f-08db4ccb715c X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2023 18:14:47.0325 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iVujsoujIugVhxemPV6oKemYNszRpSeiKyYNwFfp404EdPkUylWJv7k+CqR+IlugPCndnDYjTC8cQi9f8MtmGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4758 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-04_12,2023-05-04_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305040147 X-Proofpoint-GUID: SM0gglqFKYuZWXndTMaVj6280GHJEkO5 X-Proofpoint-ORIG-GUID: SM0gglqFKYuZWXndTMaVj6280GHJEkO5 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi Dave, >> diff --git a/Documentation/ABI/stable/sysfs-block b/Documentation/ABI/stable/sysfs-block >> index 282de3680367..f3ed9890e03b 100644 >> --- a/Documentation/ABI/stable/sysfs-block >> +++ b/Documentation/ABI/stable/sysfs-block >> @@ -21,6 +21,48 @@ Description: >> device is offset from the internal allocation unit's >> natural alignment. >> >> +What: /sys/block//atomic_write_max_bytes >> +Date: May 2023 >> +Contact: Himanshu Madhani >> +Description: >> + [RO] This parameter specifies the maximum atomic write >> + size reported by the device. An atomic write operation >> + must not exceed this number of bytes. >> + >> + >> +What: /sys/block//atomic_write_unit_min >> +Date: May 2023 >> +Contact: Himanshu Madhani >> +Description: >> + [RO] This parameter specifies the smallest block which can >> + be written atomically with an atomic write operation. All >> + atomic write operations must begin at a >> + atomic_write_unit_min boundary and must be multiples of >> + atomic_write_unit_min. This value must be a power-of-two. > > What units is this defined to use? Bytes? Bytes > >> + >> + >> +What: /sys/block//atomic_write_unit_max >> +Date: January 2023 >> +Contact: Himanshu Madhani >> +Description: >> + [RO] This parameter defines the largest block which can be >> + written atomically with an atomic write operation. This >> + value must be a multiple of atomic_write_unit_min and must >> + be a power-of-two. > > Same question. Also, how is this different to > atomic_write_max_bytes? Again, this is bytes. We can add "bytes" to the name of these other files if people think it's better. Unfortunately request_queue sysfs file naming isn't consistent here to begin with. atomic_write_unit_max is largest application block size which we can support, while atomic_write_max_bytes is the max size of an atomic operation which the HW supports. From your review on the iomap patch, I assume that now you realise that we are proposing a write which may include multiple application data blocks (each limited in size to atomic_write_unit_max), and the limit in total size of that write is atomic_write_max_bytes. user applications should only pay attention to what we return from statx, that being atomic_write_unit_min and atomic_write_unit_max. atomic_write_max_bytes and atomic_write_boundary is only relevant to the block layer. > >> + >> + >> +What: /sys/block//atomic_write_boundary >> +Date: May 2023 >> +Contact: Himanshu Madhani >> +Description: >> + [RO] A device may need to internally split I/Os which >> + straddle a given logical block address boundary. In that >> + case a single atomic write operation will be processed as >> + one of more sub-operations which each complete atomically. >> + This parameter specifies the size in bytes of the atomic >> + boundary if one is reported by the device. This value must >> + be a power-of-two. > > How are users/filesystems supposed to use this? As above, this is not relevant to the user. > >> + >> >> What: /sys/block//diskseq >> Date: February 2021 >> diff --git a/block/blk-settings.c b/block/blk-settings.c >> index 896b4654ab00..e21731715a12 100644 >> --- a/block/blk-settings.c >> +++ b/block/blk-settings.c >> @@ -59,6 +59,9 @@ void blk_set_default_limits(struct queue_limits *lim) >> lim->zoned = BLK_ZONED_NONE; >> lim->zone_write_granularity = 0; >> lim->dma_alignment = 511; >> + lim->atomic_write_unit_min = lim->atomic_write_unit_max = 1; > > A value of "1" isn't obviously a power of 2, nor does it tell me > what units these values use. I think that we should store these in bytes. > >> + lim->atomic_write_max_bytes = 512; >> + lim->atomic_write_boundary = 0; > > The behaviour when the value is zero is not defined by the syfs > description above. I'll add it. A value of zero means no atomic boundary. > >> } >> >> /** >> @@ -183,6 +186,59 @@ void blk_queue_max_discard_sectors(struct request_queue *q, >> } >> EXPORT_SYMBOL(blk_queue_max_discard_sectors); >> >> +/** >> + * blk_queue_atomic_write_max_bytes - set max bytes supported by >> + * the device for atomic write operations. >> + * @q: the request queue for the device >> + * @size: maximum bytes supported >> + */ >> +void blk_queue_atomic_write_max_bytes(struct request_queue *q, >> + unsigned int size) >> +{ >> + q->limits.atomic_write_max_bytes = size; >> +} >> +EXPORT_SYMBOL(blk_queue_atomic_write_max_bytes); >> + >> +/** >> + * blk_queue_atomic_write_boundary - Device's logical block address space >> + * which an atomic write should not cross. > > I have no idea what "logical block address space which an atomic > write should not cross" means, especially as the unit is in bytes > and not in sectors (which are the units LBAs are expressed in). It means that an atomic operation which straddles the atomic boundary is not guaranteed to be atomic by the device, so we should (must) not cross it to maintain atomic behaviour for an application block. That's one reason that we have all these size and alignment rules. > >> + * @q: the request queue for the device >> + * @size: size in bytes. Must be a power-of-two. >> + */ >> +void blk_queue_atomic_write_boundary(struct request_queue *q, >> + unsigned int size) >> +{ >> + q->limits.atomic_write_boundary = size; >> +} >> +EXPORT_SYMBOL(blk_queue_atomic_write_boundary); >> + >> +/** >> + * blk_queue_atomic_write_unit_min - smallest unit that can be written >> + * atomically to the device. >> + * @q: the request queue for the device >> + * @sectors: must be a power-of-two. >> + */ >> +void blk_queue_atomic_write_unit_min(struct request_queue *q, >> + unsigned int sectors) >> +{ >> + q->limits.atomic_write_unit_min = sectors; >> +} >> +EXPORT_SYMBOL(blk_queue_atomic_write_unit_min); > > Oh, these are sectors? Again, we'll change to bytes. > > What size sector? Are we talking about fixed size 512 byte basic > block units, Normally we would be referring to fixed size 512 byte basic block unit > or are we talking about physical device sector sizes > (e.g. 4kB, maybe larger in future?) > > These really should be in bytes, as they are directly exposed to > userspace applications via statx and applications will have no idea > what the sector size actually is without having to query the block > device directly... ok > >> + >> +/* >> + * blk_queue_atomic_write_unit_max - largest unit that can be written >> + * atomically to the device. >> + * @q: the reqeust queue for the device >> + * @sectors: must be a power-of-two. >> + */ >> +void blk_queue_atomic_write_unit_max(struct request_queue *q, >> + unsigned int sectors) >> +{ >> + struct queue_limits *limits = &q->limits; >> + limits->atomic_write_unit_max = sectors; >> +} >> +EXPORT_SYMBOL(blk_queue_atomic_write_unit_max); >> + >> /** >> * blk_queue_max_secure_erase_sectors - set max sectors for a secure erase >> * @q: the request queue for the device >> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c >> index f1fce1c7fa44..1025beff2281 100644 >> --- a/block/blk-sysfs.c >> +++ b/block/blk-sysfs.c >> @@ -132,6 +132,30 @@ static ssize_t queue_max_discard_segments_show(struct request_queue *q, >> return queue_var_show(queue_max_discard_segments(q), page); >> } >> ... >> >> +static inline unsigned int queue_atomic_write_unit_max(const struct request_queue *q) >> +{ >> + return q->limits.atomic_write_unit_max << SECTOR_SHIFT; >> +} >> + >> +static inline unsigned int queue_atomic_write_unit_min(const struct request_queue *q) >> +{ >> + return q->limits.atomic_write_unit_min << SECTOR_SHIFT; >> +} > > Ah, what? This undocumented interface reports "unit limits" in > bytes, but it's not using the physical device sector size to convert > between sector units and bytes. This really needs some more > documentation and work to make it present all units consistently and > not result in confusion when devices have 4kB sector sizes and not > 512 byte sectors... ok, we'll look to fix this up to give a coherent and clear interface. > > Also, I think all the byte ranges should support full 64 bit values, > otherwise there will be silent overflows in converting 32 bit sector > counts to byte ranges. And, eventually, something will want to do > larger than 4GB atomic IOs > ok, we can do that but would also then make statx field 64b. I'm fine with that if it is wise to do so - I don't don't want to wastefully use up an extra 2 x 32b in struct statx. Thanks, John