Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp104754lqo; Wed, 15 May 2024 08:53:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXT4rD47O4tNc8M0pXaYsZ7pdvLTVWPX9udSkniBXYlr3iKtj9SXOKYUS3t0NSBfBPAYMkSmP22pUZUMvJjrrzTzAjzCppvo/QMU69vPQ== X-Google-Smtp-Source: AGHT+IHocSNvRBlVA+p8pP/yOImocfjP+eh4NBgvLabIf4tH2gTsyqpFXBVzHS/EOlcCYqGcV6B4 X-Received: by 2002:a05:6512:3b94:b0:51d:8b86:6588 with SMTP id 2adb3069b0e04-5220f76f343mr11889886e87.0.1715788421119; Wed, 15 May 2024 08:53:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715788421; cv=pass; d=google.com; s=arc-20160816; b=tUXBxWNgPqL9BdKximaKb1fQyegLTE8cRZggMdp5VzIFt8ALzgtI8EMBYlh61awztA eocvlnQ5Gceg51jJb0JOcf7T9aLmHF84MFjNQejAJs6I7xBUksJc1JW7XyATqNm8rI10 ktYToR0HW0bhg058vDxE3NR8vp09yeGZ/vF7b3rianybg6qfkGHLnb234heMtjneY8wG q9KXHRsIqQhnVkxCWocfd+7Fons3Q3KdbfGjYOP4EEqy501Q9LJEJrigj/6T0jIxoRxu Egzcc0tdfHjvzGxqWoEzDnyiljupNg+s2jycAURUBPakBUaGU5FIaUmQh491cObrDSEG WMEQ== 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=28b8BtOd3FrksYzqOgmA847TC7BJTLOfSgpR3BHW3uA=; fh=l7KgI/AXydceBtEi6Yj9Wsi/+J/uo98/t+P3v3kdIdg=; b=K5hfwXQVHLirBWdLaUHOQDqwCz+irjbU4Dvu1Nl7JowJa2OQacrX1plR8hEXJxo6/I IVonsMyCDaEQHT1Uo15yXpF/xiaRXPOajmhMEU075EdMi14gN9sefmXkLhu1/LtsQy1h QyEA3srMNijjxuaT0FDMmQMJeBEjvCX7/h6vJ89k2hJ8xHffh8Ns/yHc9d+UJjxusw9B LHq0r/PdMyCNL/Gj5HY/yzVVeamJDO+KveBXE6pvtRGAoO8XRj1ZI2mzzth21WerEi+A tihq24HNLBe3mhFLXeZ9v7C9O6GNRtM7V1FWgaGQ8FwQLnrUHrIgj+5wUHNI+76B038L NYyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FYHDqIMk; 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-180094-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180094-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a3e2803e1si577999166b.220.2024.05.15.08.53.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 08:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180094-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FYHDqIMk; 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-180094-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180094-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 943ED1F2363E for ; Wed, 15 May 2024 15:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A192156245; Wed, 15 May 2024 15:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FYHDqIMk" 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 5C932156227 for ; Wed, 15 May 2024 15:53:29 +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=1715788410; cv=none; b=uEmrE0kpwpNqHxkSBC0HC4zyiOsYvL1VykL9IptjuBfrCeOGzFHlOtbHVt0RTQG/fObH4+ANgIWdJrtwoPm3aZG/XwNdF4d44mFyS/XPxeonmZRcUXSHDtw2i55OZxN1vzrXtNLmWmrNj3iRA002iGVv1xjrQ2Y4FErVMeByaMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715788410; c=relaxed/simple; bh=PLICOs1NTYI+yPAKQECK43RBujzuz7MJ5XPyRmFGsL8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=ToeZ1VGsdXP62h4pDoP8C3MpLo5T5gT5jOFLVPP1wkK4fk1JyDWRYT4XoAllRMhihv3+4debgDlmPWm21jg8jS2Wqy5E1uNcxYPt0sLkSpGX1JwO+wneE6bmVKzuE8EKpBr0lhlFi0xgyGIGwI0fnGDhdZ54iKEWnsBK8uJ55uM= 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=FYHDqIMk; 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=1715788408; 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=28b8BtOd3FrksYzqOgmA847TC7BJTLOfSgpR3BHW3uA=; b=FYHDqIMkR2T6Xay6s8VUuMjrnN8kMe7HZOMA0vTucM7pbp8OFF4vftIWrmd0qJRkZEIG1c 7KHN3Hq979sSBDgNkiJbasihrOG8ypltYHjzA2UQXOlZmi1ddkNS7aq24c+iZlYFP+XmfL iZ2u9Tb2OtgL/Cs7R4WDY1e4wv93wkM= 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-590-hEgnx29nPa2-5mEBYZ7jcQ-1; Wed, 15 May 2024 11:53:24 -0400 X-MC-Unique: hEgnx29nPa2-5mEBYZ7jcQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 106BD8058CA; Wed, 15 May 2024 15:53:24 +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 E6B6D51BF; Wed, 15 May 2024 15:53:23 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id D153C30C1C33; Wed, 15 May 2024 15:53:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id CE1FA3FB52; Wed, 15 May 2024 17:53:23 +0200 (CEST) Date: Wed, 15 May 2024 17:53:23 +0200 (CEST) From: Mikulas Patocka To: Benjamin Marzinski cc: Yang Yang , Alasdair Kergon , Mike Snitzer , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] dm: support retrieving struct dm_target from struct dm_dev In-Reply-To: Message-ID: <60bd4b9-8edd-7e22-ce8b-e5d0e43da195@redhat.com> References: <20240514090445.2847-1-yang.yang@vivo.com> <20240514090445.2847-4-yang.yang@vivo.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.5 On Wed, 15 May 2024, Benjamin Marzinski wrote: > On Tue, May 14, 2024 at 05:04:42PM +0800, Yang Yang wrote: > > Add a list to the struct dm_dev structure to store the associated > > targets, while also allowing differentiation between different target > > types. > > I still think this is more complex than it needs to be. If devices that > support flush_pass_around can guarantee that: > > 1. They will send a flush bio to all of their table devices > 2. They are fine with another target sending the flush bio to their > table devices > > Then I don't see why we need the table devices to keep track of all the > different target types that are using them. Am I missing something here? > > If we don't need to worry about sending a flush bio to a target of each > type that is using a table device, then all we need to do is call > __send_empty_flush_bios() for enough targets to cover all the table > devices. This seems a lot easier to track. We just need another flag in > dm_target, something like sends_pass_around_flush. > > When a target calls dm_get_device(), if it adds a new table device to > t->devices, then it's the first target in this table to use that device. > If flush_pass_around is set for this target, then it also sets > sends_pass_around_flush. In __send_empty_flush() if the table has > flush_pass_around set, when you iterate through the devices, you only > call __send_empty_flush_bios() for the ones with sends_pass_around_flush > set. > > Or am I overlooking something? > > -Ben Yes, I agree that it is complex. I reworked the patch, I'm testing it now and I'll send it when it passes the tests. Mikulas