Re: [PATCH v4 06/14] device-dax: ensure dev_dax->pgmap is valid for dynamic devices

2021-11-04 Thread Dan Williams
e pgmap when the dynamic dax device is released to avoid the same > pgmap ranges to be re-requested across multiple region device reconfigs. > > Suggested-by: Dan Williams > Signed-off-by: Joao Martins > --- > drivers/dax/bus.c| 8 > drivers/dax/device.c | 2 ++ >

Re: [PATCH v4 07/14] device-dax: compound devmap support

2021-11-04 Thread Dan Williams
On Fri, Aug 27, 2021 at 7:59 AM Joao Martins wrote: > > Use the newly added compound devmap facility which maps the assigned dax > ranges as compound pages at a page size of @align. Currently, this means, > that region/namespace bootstrap would take considerably less, given that > you would initia

Re: [PATCH v4 07/14] device-dax: compound devmap support

2021-11-05 Thread Dan Williams
On Fri, Nov 5, 2021 at 7:10 AM Joao Martins wrote: > > On 11/5/21 00:38, Dan Williams wrote: > > On Fri, Aug 27, 2021 at 7:59 AM Joao Martins > > wrote: > >> > >> Use the newly added compound devmap facility which maps the assigned dax > >> rang

Re: [PATCH v4 06/14] device-dax: ensure dev_dax->pgmap is valid for dynamic devices

2021-11-05 Thread Dan Williams
On Fri, Nov 5, 2021 at 5:10 AM Joao Martins wrote: > > On 11/5/21 00:31, Dan Williams wrote: > > On Fri, Aug 27, 2021 at 7:59 AM Joao Martins > > wrote: > >> > >> Right now, only static dax regions have a valid @pgmap pointer in its > >> str

Re: [PATCH v6 00/10] mm, device-dax: Introduce compound pages in devmap

2021-11-24 Thread Dan Williams
On Wed, Nov 24, 2021 at 11:10 AM Joao Martins wrote: > > Changes since v5[9]: > > * Keep @dev on the previous line to improve readability on > patch 5 (Christoph Hellwig) > * Document is_static() function to clarify what are static and > dynamic dax regions in patch 7 (Christoph Hellwig) > * Deduc

RE: [PATCH 2/9] Documentation: driver-api: correct spelling

2023-01-30 Thread Dan Williams
Randy Dunlap wrote: > Correct spelling problems for Documentation/driver-api/ as reported > by codespell. > > Signed-off-by: Randy Dunlap > Cc: Jonathan Corbet > Cc: linux-doc@vger.kernel.org > Cc: Mauro Carvalho Chehab > Cc: linux-me...@vger.kernel.org > Cc: Dan W

RE: [PATCH v3] Documentation/process/coding-style.rst: space around const

2023-10-11 Thread Dan Williams
Max Kellermann wrote: > There are currently no rules on the placement of "const", but a recent > code submission revealed that there is clearly a preference for spaces > around it. > > checkpatch.pl has no check at all for this; though it does sometimes > complain, but only because it erroneously

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dan Williams
John Groves wrote: > On 24/02/23 10:23AM, Dave Hansen wrote: > > On 2/23/24 09:42, John Groves wrote: > > > One of the key requirements for famfs is that it service vma faults > > > efficiently. Our metadata helps - the search order is n for n extents, > > > and n is usually 1. But we can still obs

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dan Williams
Dave Hansen wrote: > On 2/23/24 12:39, John Groves wrote: > >> We had similar unit test regression concerns with fsdax where some > >> upstream change silently broke PMD faults. The solution there was trace > >> points in the fault handlers and a basic test that knows apriori that it > >> *should*

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dan Williams
Matthew Wilcox wrote: > On Fri, Feb 23, 2024 at 03:50:33PM -0800, Dan Williams wrote: > > Certainly something like that would have satisified this sanity test use > > case. I will note that mm_account_fault() would need some help to figure > > out the size of the page

Re: [PATCH v1 1/2] Documentation: process: Avoid unneeded Cc: tags

2024-04-23 Thread Dan Williams
Andy Shevchenko wrote: > Add a note that explains that Cc: email header is implied by other > tags, such as Reviewed-by:. In this case an explicit Cc: is _not_ > needed. > > Signed-off-by: Andy Shevchenko > --- > Documentation/process/5.Posting.rst | 4 +++- > Documentation/process/sub

Re: [PATCH 1/2] Documentation: fix links to mailing list services

2024-06-18 Thread Dan Williams
has been effectively ignored for a while. Otherwise, Acked-by: Dan Williams [..] > diff --git a/Documentation/process/maintainer-netdev.rst > b/Documentation/process/maintainer-netdev.rst > index 5e1fcfad1c4c..fe8616397d63 100644 > --- a/Documentation/process/maintainer-netdev.rst > +++

Re: [PATCH 01/13] mm/gup.c: Remove redundant check for PCI P2PDMA page

2024-06-26 Thread Dan Williams
Alistair Popple wrote: > PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the > check in __gup_device_huge() is redundant. Remove it > > Signed-off-by: Alistair Popple > Reviewed-by: Jason Gunthorpe > Acked-by: David Hildenbrand Acked-by: Dan Williams

Re: [PATCH 00/13] fs/dax: Fix FS DAX page reference counts

2024-06-26 Thread Dan Williams
Alistair Popple wrote: > FS DAX pages have always maintained their own page reference counts > without following the normal rules for page reference counting. In > particular pages are considered free when the refcount hits one rather > than zero and refcounts are not added when mapping the page. >

Re: [PATCH 00/13] fs/dax: Fix FS DAX page reference counts

2024-06-27 Thread Dan Williams
Alistair Popple wrote: > > Dan Williams writes: > > > Alistair Popple wrote: > >> FS DAX pages have always maintained their own page reference counts > >> without following the normal rules for page reference counting. In > >> particular pages are

Re: [PATCH] docs: maintainer: discourage taking conversations off-list

2024-07-12 Thread Dan Williams
Jakub Kicinski wrote: > Multiple vendors seem to prefer taking discussions off list, and > ask contributors to work with them privately rather than just send > patches to the list. I'd imagine this is because it's hard to fit in > time for random developers popping up with features to review into >

Re: [PATCH] docs: maintainer: discourage taking conversations off-list

2024-07-12 Thread Dan Williams
Jakub Kicinski wrote: [..] > Would it help if we speak of "open forums" instead of mailing list? > I think LPC including "hallway track" fall squarely under "conducted > in a manner typical for the larger subsystem." Here's slightly edited > version: > > Open development > >

Re: [PATCH] docs: maintainer: discourage taking conversations off-list

2024-07-12 Thread Dan Williams
Jakub Kicinski wrote: [..] > > So if this goes in as is, so be it, but it feels like a missed > > opportunity to extoll the virtues of open development. The benefits are > > in the same vector as the "release early, release often" guidance where > > the urge to polish a solution in private is a com

Re: [PATCH v3 00/26] mm: introduce numa_memblks

2024-08-05 Thread Dan Williams
Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Hi, > > Following the discussion about handling of CXL fixed memory windows on > arm64 [1] I decided to bite the bullet and move numa_memblks from x86 to > the generic code so they will be available on arm64/riscv and maybe on > loonga

Re: [PATCH v3 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-08-05 Thread Dan Williams
Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Instead of looping over numa_meminfo array to detect node's start and > end addresses use get_pfn_range_for_init(). > > This is shorter and make it easier to lift numa_memblks to generic code. > > Signed-off-by: Mike Rapoport (Microso

Re: [PATCH v3 19/26] mm: introduce numa_emulation

2024-08-05 Thread Dan Williams
Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c s/codfrom/code from/ I am surprised that numa-emulation stayed x86 only for so long. I think it is useful facility for debugging NUMA scaling and heterogenous memory topologi

Re: [PATCH v3 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-08-05 Thread Dan Williams
Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > numa_cleanup_meminfo() moves blocks outside system RAM to > numa_reserved_meminfo and it uses 0 and PFN_PHYS(max_pfn) to determine > the memory boundaries. > > Replace the memory range boundaries with more portable > memblock_start_of_

Re: [PATCH v3 25/26] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-08-05 Thread Dan Williams
move these > functions from x86 to mm/numa_memblks.c and select > CONFIG_NUMA_KEEP_MEMINFO when CONFIG_NUMA_MEMBLKS=y for dax and cxl. > > Signed-off-by: Mike Rapoport (Microsoft) > Reviewed-by: Jonathan Cameron > Tested-by: Zi Yan # for x86_64 and arm64 Looks good to me: Reviewed-by: Dan Williams

Re: [PATCH v3 00/26] mm: introduce numa_memblks

2024-08-05 Thread Dan Williams
Dan Williams wrote: > Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > Hi, > > > > Following the discussion about handling of CXL fixed memory windows on > > arm64 [1] I decided to bite the bullet and move numa_memblks from x86

Re: [PATCH v13] mm: report per-page metadata information

2024-08-05 Thread Dan Williams
Pasha Tatashin wrote: [..] > Thank you for the heads up. Can you please attach a full config file, > also was anyone able to reproduce this problem in qemu with emulated > nvdimm? Yes, I can reproduce the crash just by trying to reconfigure the mode of a pmem namespace: # ndctl create-namespace -

Re: [PATCH] genalloc: Fix a set of docs build warnings

2019-10-05 Thread Dan Williams
found > > Fix these by updating the docs to match new function locations and names, > and by completing the update of one kerneldoc comment. > > Fixes: 795ee30648c7 ("lib/genalloc: introduce chunk owners") > Signed-off-by: Jonathan Corbet Thanks Jon. Apologies for the lack of due diligence on my part. Changes look good to me. Acked-by: Dan Williams

Re: [PATCH v1 29/31] docs: nvdimm: convert to ReST

2019-06-12 Thread Dan Williams
Hi Mauro, On Wed, Jun 12, 2019 at 11:38 AM Mauro Carvalho Chehab wrote: > > Rename the mtd documentation files to ReST, add an s/mtd/nvdimm/ > index for them and adjust in order to produce a nice html > output via the Sphinx build system. > > At its new index.rst, let's add a :orphan: while thi

Re: [PATCH 30/43] docs: nvdimm: convert to ReST

2019-06-28 Thread Dan Williams
is not linked to > the main index.rst file, in order to avoid build warnings. > > Signed-off-by: Mauro Carvalho Chehab Acked-by: Dan Williams

Re: [PATCH 04/39] docs: nvdimm: add it to the driver-api book

2019-06-28 Thread Dan Williams
On Fri, Jun 28, 2019 at 5:30 AM Mauro Carvalho Chehab wrote: > > The descriptions here are from Kernel driver's PoV. > > Signed-off-by: Mauro Carvalho Chehab Acked-by: Dan Williams

Re: [PATCH] switchtec: cleanup cdev init

2017-02-19 Thread Dan Williams
On Sat, Feb 18, 2017 at 12:22 PM, Logan Gunthorpe wrote: > Hi, > > Please don't apply this patch and instead apply the switchtec driver as > we submitted in v2. As per the discussion in [1], not using the cdev's > kobj parent results in incorrect reference counting and a possible use > of the cdev

Re: [PATCH 1/3] mm: add vm_insert_mixed_mkwrite()

2017-06-09 Thread Dan Williams
On Wed, Jun 7, 2017 at 1:48 PM, Ross Zwisler wrote: > To be able to use the common 4k zero page in DAX we need to have our PTE > fault path look more like our PMD fault path where a PTE entry can be > marked as dirty and writeable as it is first inserted, rather than waiting > for a follow-up dax_

Re: [PATCH 1/3] mm: add vm_insert_mixed_mkwrite()

2017-06-09 Thread Dan Williams
On Fri, Jun 9, 2017 at 8:03 PM, Ross Zwisler wrote: > On Fri, Jun 09, 2017 at 02:23:51PM -0700, Dan Williams wrote: >> On Wed, Jun 7, 2017 at 1:48 PM, Ross Zwisler >> wrote: >> > To be able to use the common 4k zero page in DAX we need to have our PTE >> > fault

Re: [RFC] doc: add maintainer book

2017-11-24 Thread Dan Williams
On Tue, Nov 21, 2017 at 2:39 PM, Tobin C. Harding wrote: > There is currently very little documentation in the kernel on maintainer > level tasks. In particular there are no documents on creating pull > requests to submit to Linus. > > Quoting Greg Kroah-Hartman on LKML: > > Anyway, this actua

Re: [PATCH v4 1/5] mm: add mkwrite param to vm_insert_mixed()

2017-07-22 Thread Dan Williams
On Fri, Jul 21, 2017 at 3:39 PM, Ross Zwisler wrote: > To be able to use the common 4k zero page in DAX we need to have our PTE > fault path look more like our PMD fault path where a PTE entry can be > marked as dirty and writeable as it is first inserted, rather than waiting > for a follow-up dax

Re: [PATCHv2 00/10] RFKill airplane-mode indicator

2016-02-22 Thread Dan Williams
On Mon, 2016-02-22 at 11:36 -0500, João Paulo Rechi Vita wrote: > This series implements an airplane-mode indicator LED trigger, which > can be > used by platform drivers. The default policy have have airplane-mode > set when > all the radios known by RFKill are OFF, and unset otherwise. This > pol

Re: [PATCH v2 1/2] scsi: fix race between simultaneous decrements of ->host_failed

2016-05-31 Thread Dan Williams
#x27;t be handled forever. > > Use atomic type for ->host_failed to fix this race. > > This fixes the problem introduced in > commit 50824d6c5657 ("[SCSI] libsas: async ata-eh"). > > Reviewed-by: Christoph Hellwig > Signed-off-by: Wei Fang Acked-by: Dan Willi

Re: [PATCH v2 1/2] scsi: fix race between simultaneous decrements of ->host_failed

2016-05-31 Thread Dan Williams
On Tue, May 31, 2016 at 8:21 PM, Dan Williams wrote: > On Tue, May 31, 2016 at 1:38 AM, Wei Fang wrote: >> sas_ata_strategy_handler() adds the works of the ata error handler >> to system_unbound_wq. This workqueue asynchronously runs work items, >> so the ata error hand

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-08 Thread Dan Williams
On Mon, 2016-02-08 at 10:41 -0500, João Paulo Rechi Vita wrote: > Provide an interface for the airplane-mode indicator be controlled > from > userspace. User has to first acquire the control through > RFKILL_OP_AIRPLANE_MODE_ACQUIRE and keep the fd open for the whole > time > it wants to be in cont

Re: [PATCH 8/9] rfkill: Userspace control for airplane mode

2016-02-10 Thread Dan Williams
On Wed, 2016-02-10 at 17:07 +0100, Johannes Berg wrote: > On Mon, 2016-02-08 at 10:11 -0600, Dan Williams wrote: > > I'd like to clarify a bit, so tell me if I'm correct or not.  Using > > RFKILL_OP_AIRPLANE_MODE_CHANGE does not actually change any device > > state.

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-24 Thread Dan Williams
Alistair Popple wrote: [..] > > > > Was there a discussion I missed about why the conversion to typical > > folios allows the page->share accounting to be dropped. > > The problem with keeping it is we now treat DAX pages as "normal" > pages according to vm_normal_page(). As such we use the normal

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-28 Thread Dan Williams
Alistair Popple wrote: [..] > >> > It follows that that the DMA-idle condition still needs to look for the > >> > case where the refcount is > 1 rather than 0 since refcount == 1 is the > >> > page-mapped-but-DMA-idle condition. > > Because if the DAX page-cache holds a reference the refcount won

Re: [PATCH v2 0/3] Make Helped-by tag supported

2024-11-08 Thread Dan Williams
Dragan Simic wrote: [..] > I'm fully aware that we may be reluctant to supporting additional tags, > because we may then end up with a whole bunch of strange tags that might > be a bit hard to understand and use properly, but I think that adding > Helped-by to the supported tag list may actually be

Re: [PATCH 07/12] huge_memory: Allow mappings of PMD sized pages

2024-10-23 Thread Dan Williams
Alistair Popple wrote: > > Alistair Popple writes: > > > Alistair Popple wrote: > >> Dan Williams writes: > > [...] > > >>> + > >>> + return VM_FAULT_NOPAGE; > >>> +} > >>> +EXPORT_SYMBOL_GPL(dax_in

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-24 Thread Dan Williams
Alistair Popple wrote: [..] >> I'm not really following this scenario, or at least how it relates to > >> the comment above. If the page is pinned for DMA it will have taken a > >> refcount on it and so the page won't be considered free/idle per > >> dax_wait_page_idle() or any of the other mm code

Re: [PATCH 01/12] mm/gup.c: Remove redundant check for PCI P2PDMA page

2024-09-21 Thread Dan Williams
Alistair Popple wrote: > PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the > check in __gup_device_huge() is redundant. Remove it > > Signed-off-by: Alistair Popple > Reviewed-by: Jason Gunthorpe > Acked-by: David Hildenbrand > --- > mm/gup.c | 5 - > 1 file changed, 5 del

Re: [PATCH 04/12] mm: Allow compound zone device pages

2024-09-21 Thread Dan Williams
use directly, call folio_entire_mapcount(). > @@ -337,6 +341,7 @@ struct folio { > /* private: */ > }; > /* public: */ > + struct dev_pagemap *pgmap; > }; > struct address_space *mapping; > pgoff_t index; > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 17506e4..e191434 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1134,6 +1134,12 @@ static inline bool is_zone_device_page(const struct > page *page) > return page_zonenum(page) == ZONE_DEVICE; > } > > +static inline struct dev_pagemap *page_dev_pagemap(const struct page *page) > +{ > + WARN_ON(!is_zone_device_page(page)); VM_WARN_ON()? With the above fixups: Reviewed-by: Dan Williams

Re: [PATCH 02/12] pci/p2pdma: Don't initialise page refcount to one

2024-09-21 Thread Dan Williams
to 1 when allocating the > + * page. > + * > + * MEMORY_TYPE_GENERIC and MEMORY_TYPE_FS_DAX pages automatically have > + * their refcount reset to one whenever they are freed (ie. after > + * their refcount drops to 0). I'll send some follow on patches to clean up device-dax. For this one: Reviewed-by: Dan Williams

Re: [PATCH 03/12] fs/dax: Refactor wait for dax idle page

2024-09-21 Thread Dan Williams
iewed-by: Jan Kara > Reviewed-by: Christoph Hellwig Looks good to me: Reviewed-by: Dan Williams

Re: [PATCH 06/12] huge_memory: Allow mappings of PUD sized pages

2024-09-21 Thread Dan Williams
Alistair Popple wrote: > Currently DAX folio/page reference counts are managed differently to > normal pages. To allow these to be managed the same as normal pages > introduce dax_insert_pfn_pud. This will map the entire PUD-sized folio > and take references as it would for a normally mapped page.

Re: [PATCH 05/12] mm/memory: Add dax_insert_pfn

2024-09-21 Thread Dan Williams
sert_page(vma, addr, page, pgprot, write); > + if (err == -ENOMEM) > + return VM_FAULT_OOM; > + if (err < 0 && err != -EBUSY) > + return VM_FAULT_SIGBUS; > + > + return VM_FAULT_NOPAGE; > +} > +EXPORT_SYMBOL_GPL(dax_insert_pfn); W

Re: [PATCH 08/12] gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2024-09-24 Thread Dan Williams
Alistair Popple wrote: > Longterm pinning of FS DAX pages should already be disallowed by > various pXX_devmap checks. However a future change will cause these > checks to be invalid for FS DAX pages so make > folio_is_longterm_pinnable() return false for FS DAX pages. > > Signed-off-by: Alistair

Re: [PATCH 09/12] mm: Update vm_normal_page() callers to accept FS DAX pages

2024-09-27 Thread Dan Williams
Alistair Popple wrote: > Currently if a PTE points to a FS DAX page vm_normal_page() will > return NULL as these have their own special refcounting scheme. A > future change will allow FS DAX pages to be refcounted the same as any > other normal page. > > Therefore vm_normal_page() will start retu

Re: [PATCH 07/12] huge_memory: Allow mappings of PMD sized pages

2024-09-26 Thread Dan Williams
Alistair Popple wrote: > Currently DAX folio/page reference counts are managed differently to > normal pages. To allow these to be managed the same as normal pages > introduce dax_insert_pfn_pmd. This will map the entire PMD-sized folio > and take references as it would for a normally mapped page.

Re: [PATCH 08/12] gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2024-09-26 Thread Dan Williams
Dan Williams wrote: > Alistair Popple wrote: > > Longterm pinning of FS DAX pages should already be disallowed by > > various pXX_devmap checks. However a future change will cause these > > checks to be invalid for FS DAX pages so make > > folio_is_longterm_pinnable() re

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-09-27 Thread Dan Williams
Alistair Popple wrote: > Currently fs dax pages are considered free when the refcount drops to > one and their refcounts are not increased when mapped via PTEs or > decreased when unmapped. This requires special logic in mm paths to > detect that these pages should not be properly refcounted, and t

Re: [PATCH v8 01/21] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD)

2025-01-03 Thread Dan Williams
Ira Weiny wrote: > Per the CXL 3.1 specification software must check the Command Effects > Log (CEL) for dynamic capacity command support. > > Detect support for the DCD commands while reading the CEL, including: > > Get DC Config > Get DC Extent List > Add DC Response > R

Re: [PATCH v6 23/26] mm: Remove pXX_devmap callers

2025-02-04 Thread Dan Williams
Alistair Popple wrote: > On Tue, Jan 14, 2025 at 10:50:49AM -0800, Dan Williams wrote: > > Alistair Popple wrote: > > > The devmap PTE special bit was used to detect mappings of FS DAX > > > pages. This tracking was required to ensure the generic mm did not > >

Re: [PATCH v6 01/26] fuse: Fix dax truncate/punch_hole fault path

2025-02-06 Thread Dan Williams
Asahi Lina wrote: > Hi, > > On February 6, 2025 1:10:15 AM GMT+01:00, Dan Williams > wrote: > >Vivek Goyal wrote: > >> On Fri, Jan 10, 2025 at 05:00:29PM +1100, Alistair Popple wrote: > >> > FS DAX requires file systems to call into the DAX layout prio

Re: [PATCH v6 01/26] fuse: Fix dax truncate/punch_hole fault path

2025-02-05 Thread Dan Williams
Vivek Goyal wrote: > On Fri, Jan 10, 2025 at 05:00:29PM +1100, Alistair Popple wrote: > > FS DAX requires file systems to call into the DAX layout prior to unlinking > > inodes to ensure there is no ongoing DMA or other remote access to the > > direct mapped page. The fuse file system implements >

Re: [PATCH v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts

2024-12-13 Thread Dan Williams
s prefer this go through -mm. Thoughts? Here is the current conflict diff vs -next: commit 2f678b756ddf2c4a0fad7819442c09d3c8b52e4e Merge: 4176cf5c5651 0f26a45ef326 Author: Dan Williams Date: Fri Dec 13 17:37:32 2024 -0800 Merge branch 'for-6.14/dax' into for-6.14/dax-next

Re: [PATCH v6 00/26] fs/dax: Fix ZONE_DEVICE page reference counts

2025-01-10 Thread Dan Williams
Andrew Morton wrote: > On Thu, 9 Jan 2025 23:05:56 -0800 Dan Williams > wrote: > > > > - Remove PTE_DEVMAP definitions from Loongarch which were added since > > >this series was initially written. > > [..] > > > > > > base-commit: e25c8d

Re: [PATCH v6 00/26] fs/dax: Fix ZONE_DEVICE page reference counts

2025-01-09 Thread Dan Williams
Alistair Popple wrote: > Main updates since v5: > > - Reworked patch 1 based on Dan's feedback. > > - Fixed build issues on PPC and when CONFIG_PGTABLE_HAS_HUGE_LEAVES >is no defined. > > - Minor comment formatting and documentation fixes. > > - Remove PTE_DEVMAP definitions from Loonga

Re: [PATCH v5 05/25] fs/dax: Create a common implementation to break DAX layouts

2025-01-09 Thread Dan Williams
Alistair Popple wrote: > On Wed, Jan 08, 2025 at 04:14:20PM -0800, Dan Williams wrote: > > Alistair Popple wrote: > > > Prior to freeing a block file systems supporting FS DAX must check > > > that the associated pages are both unmapped from user-space and not > >

Re: [PATCH v8 02/21] cxl/mem: Read dynamic capacity configuration from the device

2025-01-22 Thread Dan Williams
Jonathan Cameron wrote: > On Wed, 15 Jan 2025 14:34:36 -0800 > Dan Williams wrote: > > > Ira Weiny wrote: > > > Dan Williams wrote: > > > > Ira Weiny wrote: > > > > > > [snip] > > > > > > >

Re: [PATCH v8 02/21] cxl/mem: Read dynamic capacity configuration from the device

2025-01-22 Thread Dan Williams
Ira Weiny wrote: [..] > > The distinction is "can this DPA capacity be allocated to a region" the > > new holes introduced by DCD are cases where the partition size is > > greater than the allocatable size. Contrast to ram and pmem the > > allocatable size is always identical to the partition size.

Re: [PATCH v6 12/26] mm/memory: Enhance insert_page_into_pte_locked() to create writable mappings

2025-01-13 Thread Dan Williams
; > Signed-off-by: Alistair Popple > Suggested-by: Dan Williams > > --- > > Changes for v5: > - Minor comment/formatting fixes suggested by David Hildenbrand > > Changes since v2: > > - New patch split out from "mm/

Re: [PATCH v6 16/26] huge_memory: Add vmf_insert_folio_pmd()

2025-01-13 Thread Dan Williams
{ > struct mm_struct *mm = vma->vm_mm; > pmd_t entry; > - spinlock_t *ptl; > > - ptl = pmd_lock(mm, pmd); Apply this comment to the previous patch too, but I think this would be more self-documenting as: lockdep_assert_held(pmd_lock(mm, pmd)); ...to make it clear in this diff and into the future what the locking constraints of this function are. After that you can add: Reviewed-by: Dan Williams

Re: [PATCH v6 17/26] memremap: Add is_devdax_page() and is_fsdax_page() helpers

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > Add helpers to determine if a page or folio is a devdax or fsdax page > or folio. > > Signed-off-by: Alistair Popple > Acked-by: David Hildenbrand > > --- > > Changes for v5: > - Renamed is_device_dax_page() to is_devdax_page() for consistency. > --- > include/linux/

Re: [PATCH v6 14/26] rmap: Add support for PUD sized mappings to rmap

2025-01-13 Thread Dan Williams
sted by David. > --- > include/linux/rmap.h | 15 ++- > mm/rmap.c| 67 ++--- > 2 files changed, 78 insertions(+), 4 deletions(-) Looks mechanically correct to me. Reviewed-by: Dan Williams

Re: [PATCH v6 13/26] mm/memory: Add vmf_insert_page_mkwrite()

2025-01-13 Thread Dan Williams
++++ > 2 files changed, 38 insertions(+) Looks good to me, you can add: Reviewed-by: Dan Williams

Re: [PATCH v6 15/26] huge_memory: Add vmf_insert_folio_pud()

2025-01-13 Thread Dan Williams
mally mapped page. > > This is distinct from the current mechanism, vmf_insert_pfn_pud, which > simply inserts a special devmap PUD entry into the page table without > holding a reference to the page for the mapping. > > Signed-off-by: Alistair Popple Looks correct for what it is: Reviewed-by: Dan Williams

Re: [PATCH v6 20/26] mm/mlock: Skip ZONE_DEVICE PMDs during mlock

2025-01-13 Thread Dan Williams
dd a Fixes tag and reword the changelog a bit before adding: Reviewed-by: Dan Williams

Re: [PATCH v6 18/26] mm/gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2025-01-13 Thread Dan Williams
27; terminology seems like it was copied from the device-memory comment, but with fsdax it does not fit. How about: /* * Filesystems can only tolerate transient delays to truncate and * hole-punch operations */ > + if (folio_is_fsdax(folio)) > + return false; > + After the comment fixup you can add: Reviewed-by: Dan Williams

Re: [PATCH v6 08/26] fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > PAGE_MAPPING_DAX_SHARED is the same as PAGE_MAPPING_ANON. I think a bit a bit more detail is warranted, how about? The page ->mapping pointer can have magic values like PAGE_MAPPING_DAX_SHARED and PAGE_MAPPING_ANON for page owner specific usage. In fact, PAGE_MAPPING_DAX

Re: [PATCH v6 19/26] proc/task_mmu: Mark devdax and fsdax pages as always unpinned

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > The procfs mmu files such as smaps and pagemap currently ignore devdax and > fsdax pages because these pages are considered special. A future change > will start treating these as normal pages, meaning they can be exposed via > smaps and pagemap. > > The only difference is

Re: [PATCH v6 21/26] fs/dax: Properly refcount fs dax pages

2025-01-13 Thread Dan Williams
"share_put" anymore since it is handling both the shared and non-shared case. > } > > static struct page *dax_busy_page(void *entry) Hmm, will this ultimately become dax_busy_folio()? [..] > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54b59b

Re: [PATCH v6 05/26] fs/dax: Create a common implementation to break DAX layouts

2025-01-13 Thread Dan Williams
ation to both unmap and > wait for the page to become idle. > > Signed-off-by: Alistair Popple After resolving my confusion about retries, you can add: Reviewed-by: Dan Williams ...although some bikeshedding below that can take or leave as you wish. > > --- > > Changes f

Re: [PATCH v6 05/26] fs/dax: Create a common implementation to break DAX layouts

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > Prior to freeing a block file systems supporting FS DAX must check > that the associated pages are both unmapped from user-space and not > undergoing DMA or other access from eg. get_user_pages(). This is > achieved by unmapping the file range and scanning the FS DAX > page

Re: [PATCH v6 06/26] fs/dax: Always remove DAX page-cache entries when breaking layouts

2025-01-13 Thread Dan Williams
ystems should already have called > + * dax_break_mapping_entry() to remove all DAX > + * entries while holding a lock to prevent > + * establishing new entries. Therefore we > + * shouldn't find any here. > + */ > + WARN_ON_ONCE(1); > + > + /* > + * Delete the mapping so truncate_pagecache() > + * doesn't loop forever. > + */ > dax_delete_mapping_entry(mapping, indices[i]); > + } Looks good. With the above additional fixup you can add: Reviewed-by: Dan Williams

Re: [PATCH v6 07/26] fs/dax: Ensure all pages are idle prior to filesystem unmount

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > File systems call dax_break_mapping() prior to reallocating file > system blocks to ensure the page is not undergoing any DMA or other > accesses. Generally this is needed when a file is truncated to ensure > that if a block is reallocated nothing is writing to it. However

Re: [PATCH v6 05/26] fs/dax: Create a common implementation to break DAX layouts

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > Prior to freeing a block file systems supporting FS DAX must check > that the associated pages are both unmapped from user-space and not > undergoing DMA or other access from eg. get_user_pages(). This is > achieved by unmapping the file range and scanning the FS DAX > page

Re: [PATCH v6 22/26] device/dax: Properly refcount device dax pages when mapping

2025-01-13 Thread Dan Williams
Alistair Popple wrote: > Device DAX pages are currently not reference counted when mapped, > instead relying on the devmap PTE bit to ensure mapping code will not > get/put references. This requires special handling in various page > table walkers, particularly GUP, to manage references on the > un

Re: [PATCH v6 16/26] huge_memory: Add vmf_insert_folio_pmd()

2025-01-14 Thread Dan Williams
David Hildenbrand wrote: > > +vm_fault_t vmf_insert_folio_pmd(struct vm_fault *vmf, struct folio *folio, > > bool write) > > +{ > > + struct vm_area_struct *vma = vmf->vma; > > + unsigned long addr = vmf->address & PMD_MASK; > > + struct mm_struct *mm = vma->vm_mm; > > + spinlock_t *ptl; >

Re: [PATCH v6 08/26] fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag

2025-01-14 Thread Dan Williams
Alistair Popple wrote: [..] > > How does this case happen? I don't think any page would ever enter with > > both ->mapping and ->share set, right? > > Sigh. You're right - it can't. This patch series is getting a litte bit large > and unweildy with all the prerequisite bugfixes and cleanups. Obvio

Re: [PATCH v6 23/26] mm: Remove pXX_devmap callers

2025-01-14 Thread Dan Williams
Alistair Popple wrote: > The devmap PTE special bit was used to detect mappings of FS DAX > pages. This tracking was required to ensure the generic mm did not > manipulate the page reference counts as FS DAX implemented it's own > reference counting scheme. > > Now that FS DAX pages have their ref

Re: [PATCH v8 02/21] cxl/mem: Read dynamic capacity configuration from the device

2025-01-14 Thread Dan Williams
Ira Weiny wrote: > Devices which optionally support Dynamic Capacity (DC) are configured > via mailbox commands. CXL 3.1 requires the host to issue the Get DC > Configuration command in order to properly configure DCDs. Without the > Get DC Configuration command DCD can't be supported. > > Imple

Re: [PATCH v8 02/21] cxl/mem: Read dynamic capacity configuration from the device

2025-01-15 Thread Dan Williams
Ira Weiny wrote: > Dan Williams wrote: > > Ira Weiny wrote: > > [snip] > > > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > > > index > > > e8907c403edbd83c8a36b8d013c6bc3391207ee6..05a0718aea73b3b2a02c608bae198eac7c462523 > > >

Re: [PATCH v8 02/21] cxl/mem: Read dynamic capacity configuration from the device

2025-01-15 Thread Dan Williams
Alejandro Lucero Palau wrote: > > On 1/15/25 02:35, Dan Williams wrote: > > Ira Weiny wrote: > >> Devices which optionally support Dynamic Capacity (DC) are configured > >> via mailbox commands. CXL 3.1 requires the host to issue the Get DC > >> Con

Re: [PATCH v5 05/25] fs/dax: Create a common implementation to break DAX layouts

2025-01-08 Thread Dan Williams
Alistair Popple wrote: > Prior to freeing a block file systems supporting FS DAX must check > that the associated pages are both unmapped from user-space and not > undergoing DMA or other access from eg. get_user_pages(). This is > achieved by unmapping the file range and scanning the FS DAX > page

Re: [PATCH v5 00/25] fs/dax: Fix ZONE_DEVICE page reference counts

2025-01-08 Thread Dan Williams
Andrew Morton wrote: > On Tue, 7 Jan 2025 14:42:16 +1100 Alistair Popple wrote: > > > Device and FS DAX pages have always maintained their own page > > reference counts without following the normal rules for page reference > > counting. In particular pages are considered free when the refcount >

Re: [PATCH v5 03/25] fs/dax: Don't skip locked entries when scanning entries

2025-01-08 Thread Dan Williams
is introduced to wait. Oh wow, good eye! Did this trip up an xfstest, or did you see this purely by inspection? > Also while we are here rename get_unlocked_entry() to > get_next_unlocked_entry() to make it clear that it may advance the > iterator state. Outside of the above clarifi

Re: [PATCH v5 02/25] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range()

2025-01-08 Thread Dan Williams
this by dropping the check for mapping_mapped(). > > Signed-off-by: Alistair Popple > Suggested-by: Dan Williams Reviewed-by: Dan Williams

Re: [PATCH v5 01/25] fuse: Fix dax truncate/punch_hole fault path

2025-01-08 Thread Dan Williams
re analogous to invalidate_inode_pages2_range() semantics in terms of what @start and @end mean. You can add: Co-developed-by: Dan Williams Signed-off-by: Dan Williams ...if you end up doing a resend, or I will add it on applying to nvdimm.git if the rebase does not end up being too prickly. --

Re: [PATCH v6 24/26] mm: Remove devmap related functions and page table bits

2025-01-14 Thread Dan Williams
upporting it. > > Signed-off-by: Alistair Popple > Acked-by: Will Deacon # arm64 Hooray! Looks good to me modulo breaking up the previous patch. Reviewed-by: Dan Williams

Re: [PATCH v6 25/26] Revert "riscv: mm: Add support for ZONE_DEVICE"

2025-01-14 Thread Dan Williams
Alistair Popple wrote: > DEVMAP PTEs are no longer required to support ZONE_DEVICE so remove > them. > > Signed-off-by: Alistair Popple > Suggested-by: Chunyan Zhang > Reviewed-by: Björn Töpel This and the next are candidates to squash into the previous remove patch, right? ...and I am not sur

Re: [PATCH v2] Documentation/CoC: Spell out the TAB role in enforcement decisions

2025-03-07 Thread Dan Williams
aviors") > > Reviewed-by: Greg Kroah-Hartman > Acked-by: Miguel Ojeda > Acked-by: Steven Rostedt > Acked-by: Jonathan Corbet Acked-by: Dan Williams

Re: [PATCH v9 19/20] fs/dax: Properly refcount fs dax pages

2025-03-26 Thread Dan Williams
David Hildenbrand wrote: > > > -static inline unsigned long dax_folio_share_put(struct folio *folio) > > +static inline unsigned long dax_folio_put(struct folio *folio) > > { > > - return --folio->page.share; > > + unsigned long ref; > > + int order, i; > > + > > + if (!dax_folio_is_shar