Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4068208rdh; Fri, 29 Sep 2023 10:04:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTPddSEdiv9qZM7fJCly+9R9F+mbXxfetr455EybM2T3lEWKM4swlspD8GJ0kVdd7tjXZK X-Received: by 2002:a05:6a21:a109:b0:161:3013:b4a2 with SMTP id aq9-20020a056a21a10900b001613013b4a2mr4525344pzc.54.1696007054388; Fri, 29 Sep 2023 10:04:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696007054; cv=pass; d=google.com; s=arc-20160816; b=Dw0getvMQ+t6uTThyURzngibe5BKfqZpheuqVJO0YFaELHQlgszWa3GaekFGUvUCG8 yPAYq79glKPefZTiMQbC63TkCzARHSARwMLwSBsJKtW3j4K+ai4zxbXRE1NV24nuMrgG sh/HMtWGyQWMGcoN0JwUobavUMHpyUDCltyFFBqvZ0s92v/Pp1knGhfrtAhQrE1WGHsd TGHbRQAagtfLbrwi2MSF7L7MHxWN//E2HDK58ON/nKwmqPYygOX04goSPRqqCZuC/FtU hUxteGAjE6u4GENYlZbjWqVB7p66dToBi3Cn+4kzI2+N7jFVtCo08L+bP8KD8LchgCF/ sXlg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=cVuZiHiJsxm4zbLeUGXsGcN0aXuQSv3J86nYfRkukD0=; fh=1iRuEHlOF8pPIIm//KnskQClXHAWQgKYJIM9xXRawHY=; b=uK7pbzebS5HMeOA0o3H9ley5zryN5st83JxaitLzU9GR3lwlFMmWEub4pBhsEzPJTT lzpE529kcmm+loOhHwpTZ5sUuNnLWHN+eSRnn3DLhqJhkPBQQDEDdTPjpew47j9TPqvZ KcIxvY3o2FyQ3jinqFX14RqN9mOhsYnujHp8/pTEDic8vqTJqOBTNJkAbP5dGZmdnw6l ZcPJ2KmdhlSnTHU5gzcdkwH8bzmeW81BTSBHDf46wlLXzzcn3HEpRuJXGJHO/LFokzF8 2bjzwuGsGY8btAuJnfyJCAx58TPEEwr1U9j4wvUV1WF4bA/n95dtQ/EI4t9aI2xXshaZ Yt/g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=AHw+n45a; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xbXLjL8W; 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 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j5-20020a17090a318500b002774e4d6e7dsi1898779pjb.147.2023.09.29.10.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=AHw+n45a; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xbXLjL8W; 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 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 656B18020A3C; Fri, 29 Sep 2023 03:29:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233049AbjI2K2s (ORCPT + 99 others); Fri, 29 Sep 2023 06:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233054AbjI2K2a (ORCPT ); Fri, 29 Sep 2023 06:28:30 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2667C1A8; Fri, 29 Sep 2023 03:28:28 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SK92ww009603; Fri, 29 Sep 2023 10:28:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=cVuZiHiJsxm4zbLeUGXsGcN0aXuQSv3J86nYfRkukD0=; b=AHw+n45aLWAP88COCvnlkcGWLywqpcYoPdX1AEbHF1xjFpqf8Qx0vH8OUOHxv+ytm61s T18+CDcRz/RBJWGdYUnUdOZhaYNQ+ZRc82Ows1Vy6yzTlJU2osjFjqqKLwSQXehnPaTU +gXB/sDKdVTlr3UsIK7C3o3jNVTfMhAQZRuaBf5ZhRlF00xOkunEN3CF2rIX1IudiLBA F20tiB07WiYW22lkYu+lvkbz7Ct3r+k84YcEpoxyQJHOi7UDULHe5CmOBNMgFW0wlNBd bT1Lkq/DArNGetQLjzPrm1M5rqpd1LuxKMIjDlzRQv6wX6NGaC/OM3JRd+vUL2HeHkjR cA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9r2dpjk5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:14 +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 38TAKh39015906; Fri, 29 Sep 2023 10:28:13 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfh4vr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LzCLXMdpPj+IT4vka/mnL7osUe0cexKJUuipl7r5s2LcmnuVgYLTCWX8Ap0KbGuIPyKZlheFE8FIsdtxSxxmmK2g7f8Y0g3yiYjf2z6daG0GePImK9BnYL8YEZHdqOTDtNyxdi/Q4V+CXAXtKG/Ow1iGwCBNzxdv+OqREgGVdbn552qGEG3WKYrZWSLZhYwbjB/QnCotaln0X+ygaRzuxW8EtUR5ed0I3OoouUh/cT8w+BZNtPJ4f3i82O0IX/KSfULmJ5RhI9Fx6NVZQ1FDctYOAlz4k7CqgCDJmx9P0YRbSx6OeZxbQ2kH7AK6K3w7EAgLcLw4zTZMdqbwVJAZug== 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=cVuZiHiJsxm4zbLeUGXsGcN0aXuQSv3J86nYfRkukD0=; b=TX+HiTjIT3hGRJxiQQFtKRCU2AXEN4g8G75cbHn0Z/ET/OTnDaBZkZNbd9yVTYSTWJtE80iyBr5G4t5TUzIYYsjBIbfEZPo/M2IySfAZCdBKHv5cl5AMRQqIZjZEe9dRaWVnfYPkuUrXjmOH/9sKjJFbpYj293S1QJBDL+WptcXrFH16FlBz/Gft/8RfwZqIbTr+j2FJfR/W1LjMw8SZqRlUYKo1qz1W2FtNpHeaMMrfjEz5oCVSyoQDZidrGDqiujNcHyUqRvFNQ5UQLUawUn96T56k3/Yi8Dc1DH+PKDk2AMaAOo3mN0NRopbFxr2B2rBJbbGY5Wm2t7NUiQRsUQ== 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=cVuZiHiJsxm4zbLeUGXsGcN0aXuQSv3J86nYfRkukD0=; b=xbXLjL8WHByauy5ZIRMIXSlXSdeenEqmbHK1sv5VK8fIKGUvQPbbbXpCNtVTMgo/eEMQMWoi2SKYv4DELx3bSbvF7ociCs+v0eZ4iQP5lopaNy6Zr2f5IvIjSSvzv7tOqhkjNGsBOeG/eo2NwiTFpOeB33ilx6PyVJBkK0lRvr8= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB6153.namprd10.prod.outlook.com (2603:10b6:510:1f7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Fri, 29 Sep 2023 10:28:11 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce%7]) with mapi id 15.20.6813.027; Fri, 29 Sep 2023 10:28:11 +0000 From: John Garry To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org, John Garry Subject: [PATCH 07/21] block: Limit atomic write IO size according to atomic_write_max_sectors Date: Fri, 29 Sep 2023 10:27:12 +0000 Message-Id: <20230929102726.2985188-8-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230929102726.2985188-1-john.g.garry@oracle.com> References: <20230929102726.2985188-1-john.g.garry@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH0PR07CA0052.namprd07.prod.outlook.com (2603:10b6:510:e::27) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB6153:EE_ X-MS-Office365-Filtering-Correlation-Id: d3dde887-7db9-403d-44d0-08dbc0d6c81b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vJf7GJ35ZFPwM9xrdi6jsmHBYVqRaVAwPIiBrg/Ki49DpbG2QFXB64RhrMpAhW6FdCblIhmZGEqG0EiaqVDfXhg0EnIVtzAKMvUh3M+wHKZPuTq8ji9xkPVsYdHMGCNzgtXl5mtlbXZ81cJCMlgr+ONK/EM8aVwrop5+S1VKH3UcT9z4Dk2WibLQwG3aSUhN1ZfGeV+xCrQgNq+qlzHWQVa4479cyZFA8t8hepXqMNG+iJ2u/d3LUC9OJGviL+wUSYEczsyIy3zapV6x0xZPK9tM9wPEoYHiMPC/CstQDLh73clj1nX1ICc2dluCuGgH+KiVY6YfSgAkTGCH7vE6nzH0myAPjqYtN7o8c3fw3N5pBIcLcG4Dp88qR2gfzJhJ3ASW4qCqODu5Yf9RavMNwItJSmaMofMs4AT5hHwIAV6ZJ0ZYMNRERgegUhuyaWvHhw6qpjoNHU1ao2vBM0z6Ds2VoEgHm/SyJyMDE2FB/T9hTiU5prAeRYkLnt2ir3fVJKZg7eBC+oBYkQ0rctqc6Q/eVcg8yqROnGNblmf9nXYYYc0Gs9vzOzRhW2UKR8BIcLdslvmVGqUH91NT1xBbDsV5ujQMkFQ+25k5rOcQ6ws= 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:(13230031)(136003)(39860400002)(366004)(346002)(376002)(396003)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(6512007)(921005)(107886003)(1076003)(26005)(2616005)(8936002)(4326008)(36756003)(103116003)(66556008)(7416002)(2906002)(5660300002)(41300700001)(66946007)(86362001)(316002)(8676002)(66476007)(478600001)(38100700002)(6486002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EhmaTwfPMi/+q6vSiDySN0uI9VDxbQkO+RUP/PrGK0MgL5NOByw+ovpWPULB?= =?us-ascii?Q?BWCnRyjdh9gJXODthrB4CBdczOB19B5WhMACKvWAm5GHEpy6iWggOR2X852y?= =?us-ascii?Q?Tv9keusxIwINHfRA/Qo38wHT7L9IniEikHQx+16LZwRALWcTD9pxD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?= =?us-ascii?Q?HL7RvRFthOSKpt20xTTaXbtEDsWTHA=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3dde887-7db9-403d-44d0-08dbc0d6c81b X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 10:28:11.7002 (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: fgWKZOfdmunQGsQsmQsLhXZDFNxCoD8NbRHDAToBfWMj5l4CgxG450mr3+OqSIbQHBEDZTtdvBLVbXDuGuCFQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6153 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-29_08,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290089 X-Proofpoint-GUID: dafVnUl1F-EIX_RZaatTlGJI4LOmzBAH X-Proofpoint-ORIG-GUID: dafVnUl1F-EIX_RZaatTlGJI4LOmzBAH X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 29 Sep 2023 03:29:21 -0700 (PDT) Currently an IO size is limited to the request_queue limits max_sectors. Limit the size for an atomic write to queue limit atomic_write_max_sectors value. Signed-off-by: John Garry --- note: atomic_write_max_sectors should prob be limited to max_sectors, which it isn't block/blk-merge.c | 12 +++++++++++- block/blk.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 0ccc251e22ff..8d4de9253fe9 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -171,7 +171,17 @@ static inline unsigned get_max_io_size(struct bio *bio, { unsigned pbs = lim->physical_block_size >> SECTOR_SHIFT; unsigned lbs = lim->logical_block_size >> SECTOR_SHIFT; - unsigned max_sectors = lim->max_sectors, start, end; + unsigned max_sectors, start, end; + + /* + * We ignore lim->max_sectors for atomic writes simply because + * it may less than bio->write_atomic_unit, which we cannot + * tolerate. + */ + if (bio->bi_opf & REQ_ATOMIC) + max_sectors = lim->atomic_write_max_sectors; + else + max_sectors = lim->max_sectors; if (lim->chunk_sectors) { max_sectors = min(max_sectors, diff --git a/block/blk.h b/block/blk.h index 94e330e9c853..6f6cd5b1830a 100644 --- a/block/blk.h +++ b/block/blk.h @@ -178,6 +178,9 @@ static inline unsigned int blk_queue_get_max_sectors(struct request *rq) if (unlikely(op == REQ_OP_WRITE_ZEROES)) return q->limits.max_write_zeroes_sectors; + if (rq->cmd_flags & REQ_ATOMIC) + return q->limits.atomic_write_max_sectors; + return q->limits.max_sectors; } -- 2.31.1