Received: by 10.213.65.68 with SMTP id h4csp3906062imn; Tue, 3 Apr 2018 12:48:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx49XI61NSkaz2yMJJfrMFSmqKap0ZmTMqS3NtArA+FEoywgcw8Ab7c+RTFnF8LQWyPvUp2Yw X-Received: by 10.98.225.20 with SMTP id q20mr11596976pfh.142.1522784920871; Tue, 03 Apr 2018 12:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522784920; cv=none; d=google.com; s=arc-20160816; b=e7LulVbH6YObjTwTAYUcRZv61MZuIFMBfe8p2qtskDHsbEwUhi8cjjPvkrdR57lAwl 7byIrlhME98Ls5V8SiCO/Fn99uGcAERzJyiNq57Av5F5HRHE+Qb5pFxa8qHxM3DQOsx/ A3QTbCdEA/5rPBOkmoGa+aJzgpzyi262H0/AwP8aGPwPsXtjQkFqd4DxMwV8z5z2i216 aQQ8TGFU9wR9+OcQEb6jKKAxOioTqqEyxRG0kfTqKmgW8nxptOcKr0lhcePOeZXKnxlf FCS0MPTDCu02Ybi3NmHZnj2HxloHHiYplyi0ukf1ALCrb6zHsEyXJYgCvqcbf2/IH6pl 530w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=egRbUusSSDXJBlT4IGlYN/ElspscyDatzHBxLxuAF2o=; b=IzVhZDfvq61guQrmfhuEkqb+dTKCUz+Ph2m5aNevqWldu6nLTY5ugjredOROajiKSP Er6hQID+gbNfAwwt4Nyg4T9nJ/V5GPU2dWTLdznjrdYZf6U9f/MAfzPcwErS7RD/knNp HxPGqz0dF0wTlimoA/1rxeJBVEYB8RC6G/r8UXjqpBcO4RHzmmxPjq3f9WJs63nGvYgo 5zTF5DMI87E5IsgU7P3Rbhw04cDfJANOM7gvMvUh/dDYBJXuSPyHpT9asmOOyu+ccBl5 UFqKOrgkb7zCrzbHs0aGTmMczUqwwKmwHnGAk9l2IiwF3Uzw9NdRPC/qAM7A8p803O/V uU4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=E6SF1Hid; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si3600014plm.671.2018.04.03.12.48.25; Tue, 03 Apr 2018 12:48:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=E6SF1Hid; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbeDCTrR (ORCPT + 99 others); Tue, 3 Apr 2018 15:47:17 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:42557 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420AbeDCTrP (ORCPT ); Tue, 3 Apr 2018 15:47:15 -0400 Received: by mail-oi0-f48.google.com with SMTP id l190-v6so17099672oig.9 for ; Tue, 03 Apr 2018 12:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=egRbUusSSDXJBlT4IGlYN/ElspscyDatzHBxLxuAF2o=; b=E6SF1HidMIHSTrIV9pAcSxuywL0SNUu89jdYjVWeLzjnH+/MDuGvKXtPvjlok/jRO3 0yGYRDdMy7DaUtdlFxM4Vzc48QhBy01zcVWKHAioOA33gnU6RqU9SBeHHylSoeD+XD3U bdEq+eN5mSv7pklPXiYBktezYpt0HqyxmRZKnQ3uySvKISoNdblD2WqdNFeaxNf52HKd O6gyRAH39PIdONwBokqyy/lnmY4Yi0YLxEff/kuxImtbYm6e+tggXS9TOISDqGndA0tn lQT2EZ7e8sOnAoWIyMtlQofKzCw/u6Ifdcn+ewETqmeD/N3gjhWR5tA8wzZjMDJY5Awh AKQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=egRbUusSSDXJBlT4IGlYN/ElspscyDatzHBxLxuAF2o=; b=BowNHw+HRgZRuDiGTmP9nJ+HKGO2nDzD+lfduzylH/21iRltmWhksNzucehAcNMck7 KScIKVt0UuKYfIv1j66Z0vRvzAoSOdSfwxr4I97J0ce46LEZtRPT8m/57jhyK0YuSaSr 7FonYVFUEdr2X5HGbyVenRpvQn0MyHjLxlyijOD3mzkfVl4vsIb1ELHRgXFBLDscgVEH MJZFTaYFmtIL0yDRzaCjKsx/e4a8vJqEO85vpDLZa8ktW06x9sIAzOvwpx7iP0EP600y MsqmbU2Y53EFUtscmTVhS10q5aK9Q6yZNWsTVTKqZcDfQzsGmg/Hm3/bajRnaParewnH R0ag== X-Gm-Message-State: ALQs6tDLDHSFYlsJ0s0STcHQSf0II8DdQB1e0vyoNfrN9W076qI5p/U0 XJKJNkBDCcNNLUgTPIQ2vMYdBS9LALmZDjcDpIWZhw== X-Received: by 2002:aca:b80a:: with SMTP id i10-v6mr8025327oif.72.1522784834414; Tue, 03 Apr 2018 12:47:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2435:0:0:0:0:0 with HTTP; Tue, 3 Apr 2018 12:47:14 -0700 (PDT) In-Reply-To: <20180403193912.GC6556@redhat.com> References: <152246892890.36038.18436540150980653229.stgit@dwillia2-desk3.amr.corp.intel.com> <152246898322.36038.17918469633893320678.stgit@dwillia2-desk3.amr.corp.intel.com> <20180403193912.GC6556@redhat.com> From: Dan Williams Date: Tue, 3 Apr 2018 12:47:14 -0700 Message-ID: Subject: Re: [PATCH v8 10/18] dax, dm: introduce ->fs_{claim, release}() dax_device infrastructure To: Mike Snitzer Cc: linux-nvdimm , Alasdair Kergon , Matthew Wilcox , Ross Zwisler , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Christoph Hellwig , Jan Kara , david , linux-fsdevel , linux-xfs , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 3, 2018 at 12:39 PM, Mike Snitzer wrote: > On Tue, Apr 03 2018 at 2:24pm -0400, > Dan Williams wrote: > >> On Fri, Mar 30, 2018 at 9:03 PM, Dan Williams wrote: >> > In preparation for allowing filesystems to augment the dev_pagemap >> > associated with a dax_device, add an ->fs_claim() callback. The >> > ->fs_claim() callback is leveraged by the device-mapper dax >> > implementation to iterate all member devices in the map and repeat the >> > claim operation across the array. >> > >> > In order to resolve collisions between filesystem operations and DMA to >> > DAX mapped pages we need a callback when DMA completes. With a callback >> > we can hold off filesystem operations while DMA is in-flight and then >> > resume those operations when the last put_page() occurs on a DMA page. >> > The ->fs_claim() operation arranges for this callback to be registered, >> > although that implementation is saved for a later patch. >> > >> > Cc: Alasdair Kergon >> > Cc: Mike Snitzer >> >> Mike, do these DM touches look ok to you? We need these ->fs_claim() >> / ->fs_release() interfaces for device-mapper to set up filesystem-dax >> infrastructure on all sub-devices whenever a dax-capable DM device is >> mounted. It builds on the device-mapper dax dependency removal >> patches. > > I'd prefer dm_dax_iterate() be renamed to dm_dax_iterate_devices() Ok, I'll fix that up. > But dm_dax_iterate() is weird... it is simply returning the struct > dax_device *dax_dev that is passed: seemingly without actually directly > changing anything about that dax_device (I can infer that you're > claiming the underlying devices, but...) I could at least add a note to see the comment in dm_dax_dev_claim(). The filesystem caller expects to get a dax_dev back or NULL from fs_dax_claim_bdev() if the claim failed. For fs_dax_claim() the return value could simply be bool for pass / fail, but I used dax_dev NULL / not-NULL instead. In the case of device-mapper the claim attempt can't fail for conflicting ownership reasons because the exclusive ownership of the underlying block device is already established by device-mapper before the fs claims the device-mapper dax device. > In general user's of ti->type->iterate_devices can get a result back > (via 'int' return).. you aren't using it that way (and maybe dax will > never have a need to return an answer). But all said, I think I'd > prefer to see dm_dax_iterate_devices() return void. > > But please let me know if I'm missing something, thanks. Oh, yeah, I like that better. I'll just make it return void and have dm_dax_fs_claim() return the dax_dev directly. Thanks Mike!