Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2583806lqb; Tue, 28 May 2024 04:46:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjDcdHJ5EE8pOw/5IEB9xxiKBXwf9oWDRKllFchE0Y4cppUXWzVLavdqHKfU0q8K8pt/W3IqG0wlvmmFpbYJVRGKgdaCWRir+EBiHhHg== X-Google-Smtp-Source: AGHT+IGeWpHpjU1AJSVUFiZtISFwzLemNwim/d/2Ac6m92pPTu33zK9LyzYEz+yj/5hUrXMJECyQ X-Received: by 2002:a05:6358:2489:b0:183:a0ac:b5c2 with SMTP id e5c5f4694b2df-197e51017b9mr1476209155d.11.1716896809639; Tue, 28 May 2024 04:46:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716896809; cv=pass; d=google.com; s=arc-20160816; b=iBqTJjVIb3YAp3lKwIyLkHyrQenPzGDm1NhH1EvVYRkut8gWBXI2XmfAK1IbfvfXEY 2BrvQ8KH/g2HJdN5atbCPeuVt4GXrp3KKyQ7X7TXD+ITw4pmyl6MgyfaPEtpn+MqBPGG mv2AYHP6dpkri56fhL/ICIJm2afjD4Aa24dYswa28NKBYRGnrzW1b7sXlwn0JVV/s+WQ UgHouF1qzBV4Dn2931jTWsNT6m8aKqc4F4VAWShxr0uRFKXsNnKAJa566ErYB5J5izjj tyBE6uiorEN8+uGwphxRN/6F+3ZDyfu1rE1E1psvxgiwbxcOBi2NvxoFJrkhifvLG+9c i8NQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=cR2bt1k7HyvsTYH0cB1zhL4rvahDLosFkY2Z9XJBKj4=; fh=NMgp+XPkaWEs+DgFL7qTLJYnc8VIjHGzkYiYS1cnKZg=; b=Kr/4MyrZXwxT87Id02LpFzpI0F6/AOmP2tQgrcJEZQCjEdrZvs0DpLLF23+gSt9N+O xVrIsb1YOCBVe93rL6M9XsiEvgxOskOC4DuFo+qlJvyWe7r5GtGy2DGS8kLQ70rqxYOh +L4SJWTwgGqJipS5F4s8zihLZPb80gLpwW3H2NbDJCLGbo6VNODSU1zaheUgacj75o49 0bA3uE9E+PsTF/T61+yXe4LziQFTsRLA5s6GHCTqwJtILXA7CrQDrgSpKA5nc1kMAD1q ClVCbCxbYZL6wyGTGkoMcItFtQjpTdHjM6MUOBmPfTnKBP03Lfx4ewhprA1j1nXJP561 8bFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hzHHvYxp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-192189-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b75850si8059065a12.107.2024.05.28.04.46.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 04:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192189-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hzHHvYxp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-192189-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B989428A8F0 for ; Tue, 28 May 2024 11:38:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 832C716C69D; Tue, 28 May 2024 11:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hzHHvYxp" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 5525A16C854 for ; Tue, 28 May 2024 11:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716896280; cv=none; b=pdacealmDCfsHI/xqCJFdDxcRVxFYdjsbq3cBVokf3ljhzMQLuN2DPIG13PaxNfeP9faRfsW+uv7iMR8KltLWYWnL6vZe1F+D7JiNM1zfslXB/ZoUB94TI/JKEbZpdNpVPJ7sak9wJ9gsgUffCzxO7yiuEb9L0eg4VvQ8Y5TQn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716896280; c=relaxed/simple; bh=qsUEMsJeSS+IBw2BPZZTlJN3EV1oMrAZQyqKVRUbvtE=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=bzU11THBcs7lKoxdA+N6FOBWCwCtkJ4N8hRwHriqQst84TBzrbibvjgwVx+MnY3p3Lv4FDaleprzfvdmz4Q1sH3kSYt3SSWblnvlRbwSwtneaxvZWjjzP2XAlenm3WJkdCzAtujroGru4ugcdFarwhqvP6GLjsLjlOdRBL7j3ac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hzHHvYxp; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716896278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cR2bt1k7HyvsTYH0cB1zhL4rvahDLosFkY2Z9XJBKj4=; b=hzHHvYxpq+FsTLqXvk3EO71TXhDzb/11TYP/7H1pbeIf1JguOJj3t2OWxrjQOSW8AFMyZm spfYLgnOoN1/U+03z99VxT0EaXKu16Xn82NN8q5zi6ZJ/8jXnRTZG8vow+b/Fg0CJnr6fh ufaUx7n9EFhEHvIiqq6XF0aw4f0CEsU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-t2Ce_dVVNM-Zrr8EG9E22Q-1; Tue, 28 May 2024 07:37:54 -0400 X-MC-Unique: t2Ce_dVVNM-Zrr8EG9E22Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B007881227E; Tue, 28 May 2024 11:37:53 +0000 (UTC) Received: from file1-rdu.file-001.prod.rdu2.dc.redhat.com (unknown [10.11.5.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E44710004FF; Tue, 28 May 2024 11:37:53 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id 872D230C1C33; Tue, 28 May 2024 11:37:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id 8623A43520; Tue, 28 May 2024 13:37:53 +0200 (CEST) Date: Tue, 28 May 2024 13:37:53 +0200 (CEST) From: Mikulas Patocka To: Mike Snitzer cc: Benjamin Marzinski , Yang Yang , Alasdair Kergon , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] dm: optimize flushes In-Reply-To: Message-ID: <96148bb3-42e3-a5e2-63fb-ad7f67ba4fea@redhat.com> References: <20240514090445.2847-1-yang.yang@vivo.com> <20240514090445.2847-4-yang.yang@vivo.com> <60bd4b9-8edd-7e22-ce8b-e5d0e43da195@redhat.com> <90f4beb-2e15-3f9-4bc2-0d13872e8ea@redhat.com> <44afd6c8-d36a-4b9d-e77f-fca269a9897b@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 On Thu, 23 May 2024, Mike Snitzer wrote: > On Thu, May 23, 2024 at 07:46:25PM +0200, Mikulas Patocka wrote: > > Hi > > > > Here I'm resending the patch, with more comments and explanations added. > > > > Mikulas > > > > > > From: Mikulas Patocka > > > > Device mapper sends flush bios to all the targets and the targets send it > > to the underlying device. That may be inefficient, for example if a table > > contains 10 linear targets pointing to the same physical device, then > > device mapper would send 10 flush bios to that device - despite the fact > > that only one bio would be sufficient. > > > > This commit optimizes the flush behavior. It introduces a per-target > > variable flush_bypasses_map - it is set when the target supports flush > > optimization - currently, the dm-linear and dm-stripe targets support it. > > When all the targets in a table have flush_bypasses_map, > > flush_bypasses_map on the table is set. __send_empty_flush tests if the > > table has flush_bypasses_map - and if it has, no flush bios are sent to > > the targets via the "map" method and the list dm_table->devices is > > iterated and the flush bios are sent to each member of the list. > > > > Signed-off-by: Mikulas Patocka > > Suggested-by: Yang Yang > > Nicely done, please feel free to stage for 6.11 (create a new > 'dm-6.11' branch starting from 'dm-6.10' -- we'll need to rebase > dm-6.11 to 6.10-rc2 or so but at least we'll get this commit in the > pipeline, push to 'for-next'). > > Reviewed-by: Mike Snitzer OK, done. Mikulas