Skip to content

Commit 653d782

Browse files
djbwakpm00
authored andcommitted
dcssblk: mark DAX broken, remove FS_DAX_LIMITED support
The dcssblk driver has long needed special case supoprt to enable limited dax operation, so called CONFIG_FS_DAX_LIMITED. This mode works around the incomplete support for ZONE_DEVICE on s390 by forgoing the ability of dax-mapped pages to support GUP. Now, pending cleanups to fsdax that fix its reference counting [1] depend on the ability of all dax drivers to supply ZONE_DEVICE pages. To allow that work to move forward, dax support needs to be paused for dcssblk until ZONE_DEVICE support arrives. That work has been known for a few years [2], and the removal of "pte_devmap" requirements [3] makes the conversion easier. For now, place the support behind CONFIG_BROKEN, and remove PFN_SPECIAL (dcssblk was the only user). Link: http://lore.kernel.org/cover.9f0e45d52f5cff58807831b6b867084d0b14b61c.1725941415.git-series.apopple@nvidia.com [1] Link: http://lore.kernel.org/20210820210318.187742e8@thinkpad/ [2] Link: http://lore.kernel.org/4511465a4f8429f45e2ac70d2e65dc5e1df1eb47.1725941415.git-series.apopple@nvidia.com [3] Link: https://lkml.kernel.org/r/33eef2379c0d240f40cc15453fad2df1a4ae34c8.1740713401.git-series.apopple@nvidia.com Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Tested-by: Alexander Gordeev <agordeev@linux.ibm.com> Acked-by: David Hildenbrand <david@redhat.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Jan Kara <jack@suse.cz> Cc: Matthew Wilcox <willy@infradead.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Alistair Popple <apopple@nvidia.com> Cc: Asahi Lina <lina@asahilina.net> Cc: Balbir Singh <balbirs@nvidia.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chunyan Zhang <zhang.lyra@gmail.com> Cc: "Darrick J. Wong" <djwong@kernel.org> Cc: Dave Chinner <david@fromorbit.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Ira Weiny <ira.weiny@intel.com> Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: John Hubbard <jhubbard@nvidia.com> Cc: linmiaohe <linmiaohe@huawei.com> Cc: Logan Gunthorpe <logang@deltatee.com> Cc: Michael "Camp Drill Sergeant" Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Peter Xu <peterx@redhat.com> Cc: Ted Ts'o <tytso@mit.edu> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: WANG Xuerui <kernel@xen0n.name> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent e5cb232 commit 653d782

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

Documentation/filesystems/dax.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ implement direct_access.
207207

208208
These block devices may be used for inspiration:
209209
- brd: RAM backed block device driver
210-
- dcssblk: s390 dcss block device driver
211210
- pmem: NVDIMM persistent memory driver
212211

213212

drivers/s390/block/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ comment "S/390 block device drivers"
44

55
config DCSSBLK
66
def_tristate m
7-
select FS_DAX_LIMITED
8-
select DAX
97
prompt "DCSSBLK support"
108
depends on S390 && BLOCK
119
help
1210
Support for dcss block device
1311

12+
config DCSSBLK_DAX
13+
def_bool y
14+
depends on DCSSBLK
15+
# requires S390 ZONE_DEVICE support
16+
depends on BROKEN
17+
select DAX
18+
prompt "DCSSBLK DAX support"
19+
help
20+
Enable DAX operation for the dcss block device
21+
1422
config DASD
1523
def_tristate y
1624
prompt "Support for DASD devices"

drivers/s390/block/dcssblk.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,21 @@ static const struct attribute_group *dcssblk_dev_attr_groups[] = {
534534
NULL,
535535
};
536536

537+
static int dcssblk_setup_dax(struct dcssblk_dev_info *dev_info)
538+
{
539+
struct dax_device *dax_dev;
540+
541+
if (!IS_ENABLED(CONFIG_DCSSBLK_DAX))
542+
return 0;
543+
544+
dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops);
545+
if (IS_ERR(dax_dev))
546+
return PTR_ERR(dax_dev);
547+
set_dax_synchronous(dax_dev);
548+
dev_info->dax_dev = dax_dev;
549+
return dax_add_host(dev_info->dax_dev, dev_info->gd);
550+
}
551+
537552
/*
538553
* device attribute for adding devices
539554
*/
@@ -547,7 +562,6 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
547562
int rc, i, j, num_of_segments;
548563
struct dcssblk_dev_info *dev_info;
549564
struct segment_info *seg_info, *temp;
550-
struct dax_device *dax_dev;
551565
char *local_buf;
552566
unsigned long seg_byte_size;
553567

@@ -674,14 +688,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
674688
if (rc)
675689
goto put_dev;
676690

677-
dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops);
678-
if (IS_ERR(dax_dev)) {
679-
rc = PTR_ERR(dax_dev);
680-
goto put_dev;
681-
}
682-
set_dax_synchronous(dax_dev);
683-
dev_info->dax_dev = dax_dev;
684-
rc = dax_add_host(dev_info->dax_dev, dev_info->gd);
691+
rc = dcssblk_setup_dax(dev_info);
685692
if (rc)
686693
goto out_dax;
687694

@@ -917,7 +924,7 @@ __dcssblk_direct_access(struct dcssblk_dev_info *dev_info, pgoff_t pgoff,
917924
*kaddr = __va(dev_info->start + offset);
918925
if (pfn)
919926
*pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset),
920-
PFN_DEV|PFN_SPECIAL);
927+
PFN_DEV);
921928

922929
return (dev_sz - offset) / PAGE_SIZE;
923930
}

0 commit comments

Comments
 (0)