Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp121224lqo; Thu, 16 May 2024 00:43:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjj7+GespCGhZoiJd5kbUJ5jI9rmrBUzmevgtrPCBbp9UkAuXNJpRm10tKMIiRzT3IXGhDx6FvMNypu9a3DKeE1sUZv3ZGt4/ylI+ihg== X-Google-Smtp-Source: AGHT+IGiHFPGRcrHJ1gT+KUXrWiW15wcOzmo0zSdEjqB5d/Y5R9rZHqtjpoTvDi6vu4WMRqbdAFG X-Received: by 2002:ac8:59d6:0:b0:43b:18b7:5584 with SMTP id d75a77b69052e-43dfdb20f5bmr229034581cf.8.1715845404756; Thu, 16 May 2024 00:43:24 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df549dbe9si142025101cf.46.2024.05.16.00.43.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 00:43:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=kQcNMzQQ; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-180716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6DB411C2145E for ; Thu, 16 May 2024 07:43:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E9034120A; Thu, 16 May 2024 07:43:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="kQcNMzQQ" Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2048.outbound.protection.outlook.com [40.107.215.48]) (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 1629F4EB56 for ; Thu, 16 May 2024 07:43:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.48 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715845395; cv=fail; b=OnrVFOuavxrygDk+8PN5WiF0k1brblL9QazuP7wRT1mHaHgm1Xtx6LQPX4Fvaz3wanW4AS2EiGgAE+m7Kn45enAZ4mJ1heNefiMP/+LeyQwTK3G8oPL9GLT4i1I4TRWuQ/MhS6cA5mLsRK+p6CeMUT+4OZjmG5jkibiVxmolgcM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715845395; c=relaxed/simple; bh=QlDupdg8sJ3EnBzBEmFpa2xfkoq/LFfkdJLDSDyXMpc=; h=Message-ID:Date:Subject:To:References:From:In-Reply-To: Content-Type:MIME-Version; b=JoRQORnhh+/tp7JL8Ih93thESDXRrOfjUAo0TkWcCQSSkXwaQW8ZDtClIm9u42nI2BpsWVdYxI5v9S2g3fOcogcygeLfrBKbaJ1zXUiqqcRoPtmEit7CdnTwD2QkCtStOV+yzosdl4ai33ihYYfCMCOGC3wLPRdfO6wrVb92N4A= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=kQcNMzQQ; arc=fail smtp.client-ip=40.107.215.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hb2jc86Ah12hQot8UXpr8+F+uEXWzP6wx+ro33aGfEoFiR4mkwvlpzAP4ndDb+aD8mPAHHpSL+mrsJqg4yQQ9yq6xyfVv4phMcxrFahhLcK6b3fe/fK4k+idK/NPVmIa7VxoHxaAiJGaomi18w1hSEE0jJNgrE/aP3W+chv1UdRYCo963VIJs+gb9eh0OWZWXtfhhZ207GiLqKTu1R5tvF9d3ROI8cn0TRL21YilOdr8E9J+FROD43AHUr+6BKHQJiklw7ogCf8cVticCIaBmFCJZTU2vW2ue5s3poWTirlAmlHEllses8avJXB99rIjG9BZDttk66FkQxekVtm5ZA== 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=KfTGmahX3n26orNwhDgLhuS6DAJu/b64HX+JYVtS41U=; b=Zqqnk3q9KnB5sdxJZSCgiOJXI0/G40MstS9y88AIMoOQ4OjK2UDM0hU4Zzor1wfJ9fMeRBN6bZZPoGY6bDI4LleW+iSGrigVLKulsWlxT3hFHtXT0S+zx1p2bQ+T2HOSoeXlenFUFHpLmyYJsQOTraGSCStyMdDL6nP7OAhWCE5OjZd1yD7iwAlMum0qBtHAz5u/qd7tWp6VfVqV41LZJIHWWiKhV/YSDSiLCGLbVQX13NZYKsCs2kRJEfhLyWok0X6rlVL3bmezMr/XTqHrTg1EJFHjCmyH6T4d4r8tTm/k5Lfe1oaE8BALfDBD4CZkol5vo/9U42EEv0Ccu/JvMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KfTGmahX3n26orNwhDgLhuS6DAJu/b64HX+JYVtS41U=; b=kQcNMzQQQaSePYnu6XBo1IwzxdLTYnjjB8RicAnyApbHtq1Dq8GctybxNx5lJ9W3q8koYoIN0qD96tprn1hfcdWmqkZE+/DLJ4NNRYr1UWSNbN+1n2QNkNOWokW8qeIqPnNXukQw7YQhHydvbhdV2zJXyqR9LEUFScaDuzKd7StdLgFNBo6AbZSoA4JgaOxXyXqQl+w2qbhW+06NYpqmEywYL8k/A4iBDBt7Zs/xQdJv2GA4+EhDT1G+QtLn/9KGsabOiYLSbR4QD9ZPIlVal7lf+EOds9xiyaFZLX0k2oe0UnhENGsG/gmNknzAFwzmmqpdxXtgi04S7KKvNlTPkg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYSPR06MB6411.apcprd06.prod.outlook.com (2603:1096:400:42a::11) by SEZPR06MB7060.apcprd06.prod.outlook.com (2603:1096:101:1f3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.25; Thu, 16 May 2024 07:43:05 +0000 Received: from TYSPR06MB6411.apcprd06.prod.outlook.com ([fe80::8e76:5af3:e027:ccee]) by TYSPR06MB6411.apcprd06.prod.outlook.com ([fe80::8e76:5af3:e027:ccee%3]) with mapi id 15.20.7587.025; Thu, 16 May 2024 07:43:05 +0000 Message-ID: Date: Thu, 16 May 2024 15:43:01 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/5] dm: empty flush optimization Content-Language: en-US To: Alasdair Kergon , Mike Snitzer , Mikulas Patocka , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org References: <20240516040235.115651-1-yang.yang@vivo.com> From: YangYang In-Reply-To: <20240516040235.115651-1-yang.yang@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: TYCPR01CA0011.jpnprd01.prod.outlook.com (2603:1096:405::23) To TYSPR06MB6411.apcprd06.prod.outlook.com (2603:1096:400:42a::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6411:EE_|SEZPR06MB7060:EE_ X-MS-Office365-Filtering-Correlation-Id: 272c859a-d973-4630-5820-08dc757bd255 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VThzdk9NWVM5b0JqYmJZOU5KUDZkQUFiaWNMOXNaTWlrWVZNbDFDMDI0STlj?= =?utf-8?B?VXN5OU9HSklrNnlTT04rWWs5VDNOUGZwSU1BNzhzZDlTT0NNUU1KRVhTbFNJ?= =?utf-8?B?VzFHSGVHamtBeEc5blI3TXhrUHQrZTFqNnJHVUV2eERKRjJ4YWdTZi8vdEFo?= =?utf-8?B?TFFnUktTVnFzSzJaR1NDK2VvaVNKbkwxMExxa1hqU0J4cHVHMGFrU0JVVk9U?= =?utf-8?B?eHUrckxiM3htMCt2OTJnUlY5MytBMjF4RUJEdG5uU3VoSllWWG16T0M4bm83?= =?utf-8?B?S0twOWtReFViQWJsS2RseDVkS3dnMk9TeDcveUZtTG05cFplZnhOVlZYL3BL?= =?utf-8?B?MWpNWVlHY3duaUpjZENYWnh1WFhyU2F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JtSW5WVVhyRWxtaEtGVkRqVlprY3lCMDV1bEM0?= =?utf-8?B?QXUvRUY4V3htVkhQNFhiN3NCTWNaYXNrR3dLUzVBWElxYllCMUtLVzNxd2hD?= =?utf-8?B?LzZSeWpnTStlcVJLUk4yNHFTc0JwSEtIWllXeU9WNDNKcVluY0VWMlR1QzJM?= =?utf-8?B?c0NxWnVidDQ3NmwwSmdZVUpsRGFSQm1IZWgyK0FFMEhsTHBXUDhwMmU4YlZO?= =?utf-8?B?ZXFFSkFTS0Q0MnRNc1dVa2h6OEZmR0pnbjN6cmNYNVZvY2NzWk8ybkdudFIv?= =?utf-8?B?Y0kvWUNWdEg1ckQzMHR4NGYzNHM1YmlUNk5HYnkvNmVCVlorWUw5U1VFalVY?= =?utf-8?B?aGNxU3AvbnlMdjlQRWF0ek9QYjFxNWxVYitISnAwdDRJNlJtMXVNVkhHZnZ6?= =?utf-8?B?UGFWQS8ybHM2TzJzc3JaYVlNV0pYM0lhcFFYNmNFSFFCK0grdnAwbEx3PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYSPR06MB6411.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TXlDcncwUml0NWI5VkxiQkZ1M2hEcDJpZ1RyVDQ5clVCbzNwbDZYS0laSHhD?= =?utf-8?B?N0QrcENmUzdvbkdidUo2SmFZQ0dhM0F0TjZDbHBpSWhnMlozNHpIa2tHUmhK?= =?utf-8?B?UTE3SDd1di9XU01vYzVXckVKUW5rVlRNdDN3dVIvdjF6K3J6TG1JU1FFS0NM?= =?utf-8?B?MXA3RytMdlZOak9OSjJNTlpSNnNtNFZxeExPZjBzMEpjalV2ejFOa1czcEZU?= =?utf-8?B?TEk3dCtaa3JW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w?= =?utf-8?B?OXVoVThMTG9iTHI1TjNYZGd4WnBNOERBMm55SGpRNzVRUmNEeTFYZEttdW4r?= =?utf-8?Q?t+5tvMYu6h3vZiuSxuITeYawP?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 272c859a-d973-4630-5820-08dc757bd255 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6411.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 07:43:05.1188 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GrGZl0PCjOWnQHK0j8bOTkjHHAHkA6vqVZqBJnNKt3Zf0iyE8JY6OcdhB4VZwtU+ZBfAx6h/+yzYYHuP++1Rsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB7060 On 2024/5/16 12:02, Yang Yang wrote: > __send_empty_flush() sends empty flush bios to every target in the > dm_table. However, if the num_targets exceeds the number of block > devices in the dm_table's device list, it could lead to multiple > invocations of __send_duplicate_bios() for the same block device. > Typically, a single thread sending numerous empty flush bios to one > block device is redundant, as these bios are likely to be merged by the > flush state machine. In scenarios where num_targets significantly > outweighs the number of block devices, such behavior may result in a > noteworthy decrease in performance. > > This is a real-world scenario that we have encountered: > 1) Call fallocate(file_fd, 0, 0, SZ_8G) > 2) Call ioctl(file_fd, FS_IOC_FIEMAP, fiemap). In situations of severe > file system fragmentation, fiemap->fm_mapped_extents may exceed 1000. > 3) Create a dm-linear device based on fiemap->fm_extents > 4) Create a snapshot-cow device based on the dm-linear device > > Perf diff of fio test: > fio --group_reporting --name=benchmark --filename=/dev/mapper/example \ > --ioengine=sync --invalidate=1 --numjobs=16 --rw=randwrite \ > --blocksize=4k --size=2G --time_based --runtime=30 --fdatasync=1 > > Scenario one: > for i in {0..1023}; do > echo $((8000*$i)) 8000 linear /dev/sda2 $((16384*$i)) > done | sudo dmsetup create example > > Before: bw=857KiB/ > After: bw=30.8MiB/s +3580% > > Scenario two: > for i in {0..1023}; do > if [[ $i -gt 511 ]]; then > echo $((8000*$i)) 8000 linear /dev/nvme0n1p6 $((16384*$i)) > else > echo $((8000*$i)) 8000 linear /dev/sda2 $((16384*$i)) > fi > done | sudo dmsetup create example > > Before: bw=1470KiB/ > After: bw=33.9MiB/s +2261% > > Any comments are welcome! > > V3: > -- Focus on targets with num_flush_bios equal to 1 to simplify the code > -- Use t->devices_lock to protect the dm_table's device list Please ignore V3, which has a build warning. I will send V4 with the fix. Thanks