From patchwork Fri Nov 1 14:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13859502 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B227019DF53; Fri, 1 Nov 2024 14:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730472711; cv=fail; b=QGNrc1anpEBcH4JZlyDGl/adeea72oLKcojysOAAXpu2RbgsW34mEIFKuiwt78XKfvAUdR33B07ZdqX87n7AyPBrGxwUsniG9T3xnaH6D1mQgfUjEBAOaRY7b3GVePEX5GqcjAboShtzUsRyf64r1IR76F8pnEihAAfGPGPuu3E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730472711; c=relaxed/simple; bh=x01FiqGtm5MCUVAiQu6Bcjp9oWzXh9FeJ2OAdsiUv54=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=V6rV2rpnWkWpVzkysjkfm2GWpoxBXd8sbnNIXa/HoEaqhvmckFc+5Dc2zM9pKdya+F1zIYAD9kxk9wSpXsaG9hyhunMiYlwjdTyugjvgFzCOjF2DOZLAL5NBP1hBoxISGN7yGJuAEhAY18ilUwsgGSvCcDtvNqXWldhdViT94rQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=JwzNihrY; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=G+XdwRY7; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="JwzNihrY"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="G+XdwRY7" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A1Ein5x026700; Fri, 1 Nov 2024 14:46:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=fphs1Zrz0qAtL9Ks ZgTu4G90VzxrjHDP2crdYDrHf2M=; b=JwzNihrY5ZuWG3JR54Mua7j82BlgHQDL TG0cxCsodU21RizGUhmqJisKkh8MkxGPdKtYCduDj8urqMAKmXYN9Yyn+tTCvat6 Jkr1W3iHSaTFq0mOxHN7vxEekfUIrizriigOyZr/51kMF02eAzAOMuU52Zd0COS6 xrBgkYR5stNiGJDQRlpmoP1DMlSBoGxRQxRH2XgRWkGmeiC7tAsIdZmzt/NWsb9f j4mtJwKozCbNyjJJnzWGAIXnCAMxecbGweLI0leHnaOJzixbNwPcu4miXKMjZ6p8 gMBm+N10glxjXq/rnKIl1ELM6MUJjQba/yng45Da1jONSQ9G1vsS9g== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grc94drh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Nov 2024 14:46:39 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A1DmUa7008486; Fri, 1 Nov 2024 14:46:37 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42hnedjrk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Nov 2024 14:46:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t+W9W+3kEWpca0TFr8Iz32kLYr8UoF8HojSNFSXcRM2vfkKDkuIkGO6LReWCsFrBdT4PkVOg4EbaRKCaDhFr/I6v6kPPT5NzW24b3dJeuOJQM7tWXIxEOnsfAPQ7Kp3S+uiiaDAg5QL+g7dKgMenZ69bQ7+FrbusTyXMY3shjBHO+Jt1CqxT01q++zc6c0gslYIUE+sZTwZTQ99qoJtPW/lVJd79Rg+K6zwlDMXpbiOmP7JNh/6iBW50ikEZvHRidh538941yWz46rsNeaL7vzNZICgeMetSjz/EPgtegeYWciyfNQfdhgWBEfSXHEXKYsXKAmXP9kb7Asrf1nmuBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fphs1Zrz0qAtL9KsZgTu4G90VzxrjHDP2crdYDrHf2M=; b=oyY2LK2cT2BCOEU8exF/ch9se05lAjZEvUJ7cVzmb3qQwyLe21tjePlUISKI2XL1uV2GXJTO445CKncOI5rTkhJp0rcNsdeKwtY/cOsv+04pVXycni0dY2i6sLcaZpYdTvG9l+u7PesTHOOg5p8JvjfHN2xTp1l7ccCzaVnrTvoRDdM7iNuITi27rWDwq72aM2G3VvrDO0RFLs7cm8Mu0rcvONk8JrKxhNKhv8J7KpqZr7l36ozKwATagSRRI8Qk/8pXeSrEKgUmgjvHQS/8K8dinGOGfiJct70n/JPOfvbULjuUkJg4oh8YLeb7Y1lCHY6FStsgX3l7u2Ly75Oa7A== 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=fphs1Zrz0qAtL9KsZgTu4G90VzxrjHDP2crdYDrHf2M=; b=G+XdwRY7NTZQTARaOWi7i3lktCaKkAMDAza3ZZVTYErkaAWF4Ge/q22R2zVxWo19FCRWkt9BP8b/A9kkaxpNNwTpbXWwFxr2B4FReaUlKoOXvQG8EbpTBSodpke7s/7bCo9DV8W/dEqR0F4T7Cjyfw3/iiif9JkNmp4ZF+Hmcrw= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by CYYPR10MB7651.namprd10.prod.outlook.com (2603:10b6:930:bc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Fri, 1 Nov 2024 14:46:31 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8114.015; Fri, 1 Nov 2024 14:46:31 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, martin.petersen@oracle.com, John Garry Subject: [PATCH v3 0/5] RAID 0/1/10 atomic write support Date: Fri, 1 Nov 2024 14:46:11 +0000 Message-Id: <20241101144616.497602-1-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: LO6P265CA0010.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:339::7) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|CYYPR10MB7651:EE_ X-MS-Office365-Filtering-Correlation-Id: 5356a621-cf20-4676-9d41-08dcfa83f958 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: CAo071fxgIumaMCUaMvWfRS5Rhp2u3tdSOwJ7icT/63m8xluf3fqSZT1B5R+pDuVfurweapYz0fxyjPa6pdOFP/OydHqa5DSy9QIhQ3eElUUuoKaujgwpMTeybML85XBZ4LcKvh2WvHS2BkXgqh2m0Cm7pVXkSuvykKrV+sKZlHFdc/VXVT17t1KE7a1Zf9CsEAf+QNhVXM3cphS7c7UJb5HBfeNvnRrW0Z662dqF36/nKHWGsizAdp7myzM0jFiZOS9xV39F3v40uLsmRqjMcoBLEnfFXyUnHmn2JaMlb+ekO1/bekoeDSbqTC6KJ+2GAogH49PDhMCbRT7KPlRyp5pysArj2C3cebDEO0DWUrQNaiG528PitRvHJKNH3iVHiIpLPThpXCx7jVJgE82VjeT0efuOU0mTVVKftzQ+HwrsUZRWbt7xkfhZo747TN71Bc8ZgXXp/Ae6kbxaKmQeXRBFCwklghYz3GC/F1CqkdNase4zufPt5/mPXRasg+Czf8PnAlAjMDasgLr8h4dwlByg/VjO9acMC3LKIh49BT2VLA+wkrT7q3Se4MAx+Sh7bJ6kmypzPgxJhc/oLDrRXddCkOXaFFMG2MhZLl9gLqf+FXXwb8keAlovfe02aAGhig3TL75s0p0+HMJmwFmaOT3L9RGPXEnEEwzoJrOzSt3YK31mAki/9qYtKMnJ8Tps89ExmynJXKW+vli62P8n3yoGiVFpNzvitaIoohmeu2KJ4jdZh58KJfqDmeq+qqp24YSO99ot7D5GgCvGgwfCXHc5ZdgJWjy7FCEZFMhuI206YZEVRFbpRLv59gSiAwNZrlzB5FkmC85Nh9uTtVNZj/iNNqGR3ftAc/Ltp7t+w9vCAKeZdTopi9AWdPkYg2fHmK9wcHe1MZ+EWsHyiLMLbrsH1w/7GS+uWe48z7NQxyoJLlsSco093b9c/khstYkceR2iPkqYQYLya0vuXvBkiexntjsl9clqFKpurzaa8vcmJ6Qi6O+DzyhPP59LspaNCruPjc1kFoBiJUbve6rzxoeh4DwiRoy2rxy3OPmmK4anQP3O+kNGOsDn+8wxXsdnMEeqtyFUUWVz9DtMlQ7Dm8fd+wUx1kn1BO7rzXYnqIdVZOQEI/o5I7Bqa0VLHTPCkclH8ydtV2L4uwvcy1yfhPWv/Qk+l6oPCk9228NZMGjWqcPq1t49tIcwwHgfeni5r5u2vAopfGtv+8kyS5hq+9QLL7VnzAGi/5Yh0OQyxSxzoj6HVDQQ/8o27ZPAgqSdPiDKBr5ucf+iq8+VxKXHCmmr/mgbzq99I6JI2XA3MESaF0CVdzdf9XL83Gs79ad 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:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PG6Wsk/BEROCtfn9KR6Bd05qVU5JsK0wgTFYrKgo9QF2TDiFWBQt7xhuOFxNprXE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rvbevSD8wHQciOijTGT6TN+RtDMUMbpO03I0HAGvH9FogQGTrN9AR8vHcCla+PJyJn41E1yT0HOZAGbGbdYYzglmEPXiwQ1gGcSpZyM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5356a621-cf20-4676-9d41-08dcfa83f958 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 14:46:31.3101 (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: +/NGNT0wmCWPCNDoV7fZOnqT6zQgnT37HMvFKEUkrSfuig/EaVQGKsxAh1BaKZq9mM0UqXceQyqJ2UKHOhMjDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7651 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-01_09,2024-11-01_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411010106 X-Proofpoint-GUID: wBFnNdkmkK0lq5pjoKtKHZx4JFVg4U6O X-Proofpoint-ORIG-GUID: wBFnNdkmkK0lq5pjoKtKHZx4JFVg4U6O This series introduces atomic write support for software RAID 0/1/10. The main changes are to ensure that we can calculate the stacked device request_queue limits appropriately for atomic writes. Fundamentally, if some bottom does not support atomic writes, then atomic writes are not supported for the top device. Furthermore, the atomic writes limits are the lowest common supported limits from all bottom devices. Flag BLK_FEAT_ATOMIC_WRITES_STACKED is introduced to enable atomic writes for stacked devices selectively. This ensures that we can analyze and test atomic writes support per individual md/dm personality (prior to enabling). Based on bio_split() rework at https://lore.kernel.org/linux-block/20241031095918.99964-1-john.g.garry@oracle.com/T/#m7bed4a956a439ac4a9fa72f0bc41d1b08ca047c6 Differences to v2: - Refactor blk_stack_atomic_writes_limits() (Christoph) - Relocate RAID 1/10 BB check (Kaui) - Add RB tag from Christoph (Thanks!) - Set REQ_ATOMIC for RAID 1/10 Differences to RFC: - Add support for RAID 1/10 - Add sanity checks for atomic write limits - Use BLK_FEAT_ATOMIC_WRITES_STACKED, rather than BLK_FEAT_ATOMIC_WRITES - Drop patch issue of truncating atomic writes - will send separately John Garry (5): block: Add extra checks in blk_validate_atomic_write_limits() block: Support atomic writes limits for stacked devices md/raid0: Atomic write support md/raid1: Atomic write support md/raid10: Atomic write support block/blk-settings.c | 132 +++++++++++++++++++++++++++++++++++++++++ drivers/md/raid0.c | 1 + drivers/md/raid1.c | 14 ++++- drivers/md/raid10.c | 14 ++++- include/linux/blkdev.h | 4 ++ 5 files changed, 161 insertions(+), 4 deletions(-)