Re: [v1 2/3] include: move lookup_or_create_module_kobject()/to_module* to module.h

2025-02-03 Thread Christoph Hellwig
> +static inline struct module_kobject * __init > lookup_or_create_module_kobject(const char *name) Crazily unreadable line. Either way this is not a function that should be inline in a header. Both due to sheer size, but also due to what it does and what it pulls in. > +{ > + struct module

Re: [PATCH v2 0/3] sysfs: constify bin_attribute argument of sysfs_bin_attr_simple_read()

2025-01-09 Thread Christoph Hellwig
On Thu, Jan 09, 2025 at 09:12:03AM +0100, Greg Kroah-Hartman wrote: > > Hey, when I duplicated the method to convert sysfs over to a proper > > seq_file based approach that avoids buffer overflows you basically > > came up with the same line that Alexei had here. > > I did? Sorry about that, I do

Re: [PATCH v2 0/3] sysfs: constify bin_attribute argument of sysfs_bin_attr_simple_read()

2025-01-09 Thread Christoph Hellwig
On Thu, Jan 09, 2025 at 08:56:37AM +0100, Greg Kroah-Hartman wrote: > The "pointless" penalty will go away once we convert all instances, and > really, it's just one pointer check, sysfs files should NOT be a hot > path for anything real, and one more pointer check should be cached and > not measur

Re: [RFC 4/4] mm: Remove include/linux/pfn_t.h

2025-01-07 Thread Christoph Hellwig
I'd just merge this into the previous patch, but otherwise this looks good: Reviewed-by: Christoph Hellwig

Re: [RFC 3/4] mm: Remove callers of pfn_t functionality

2025-01-07 Thread Christoph Hellwig
On Wed, Jan 08, 2025 at 12:18:47PM +1100, Alistair Popple wrote: > All PFN_* pfn_t flags have been removed. Therefore there is no longer > a need for the pfn_t type and all uses can be replaced with normal > pfns. Looks good in general: Reviewed-by: Christoph Hellwig Would be nice if

Re: [RFC 2/4] mm: Remove uses of PFN_DEV

2025-01-07 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [RFC 1/4] mm: Remove PFN_MAP, PFN_SG_CHAIN and PFN_SG_LAST

2025-01-07 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH 1/2] module: Put known GPL offenders in an array

2024-11-14 Thread Christoph Hellwig
d: Reviewed-by: Christoph Hellwig

Re: [PATCH 2/2] module: Block modules by Tuxedo from accessing GPL symbols

2024-11-14 Thread Christoph Hellwig
Thanks for doing this! Reviewed-by: Christoph Hellwig

Re: [RFC][PATCH 6/8] module: Add module specific symbol namespace support

2024-11-11 Thread Christoph Hellwig
On Mon, Nov 11, 2024 at 11:54:36AM +0100, Peter Zijlstra wrote: > Designate the "MODULE_${modname}" symbol namespace to mean: 'only > export to the named module'. > > Notably, explicit imports of anything in the "MODULE_" space is > forbidden. Modules implicitly get the "MODULE_${modname}" namespa

Re: [RFC][PATCH 8/8] module: Provide EXPORT_SYMBOL*_FOR() helpers

2024-11-11 Thread Christoph Hellwig
On Mon, Nov 11, 2024 at 11:54:38AM +0100, Peter Zijlstra wrote: > +#define EXPORT_SYMBOL_FOR(sym, mods) EXPORT_SYMBOL_NS(sym, "MODULE_" mods) I don't think we need a non-_GPL version of this, as the exports obviously are for in-tree modules only.

Re: [RFC][PATCH 1/8] module: Prepare for script

2024-11-11 Thread Christoph Hellwig
On Mon, Nov 11, 2024 at 11:54:31AM +0100, Peter Zijlstra wrote: > Since sed doesn't like multi-line make sure all EXPORT_SYMBOL_NS > things are a single line. Eww. Just use coccinelle or another tool not so simplistic. > @@ -375,8 +372,7 @@ int otx2_cptlf_register_done_interrupts( > otx2_c

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Christoph Hellwig
On Wed, Nov 06, 2024 at 03:42:03PM -0800, Luis Chamberlain wrote: > > This allows exports targeted at specific modules and no others -- one > > random example included. I've hated the various kvm exports we've had > > for a while, and strictly limiting them to the kvm module helps > > alleviate som

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Christoph Hellwig
On Wed, Nov 06, 2024 at 08:02:40PM +0100, Peter Zijlstra wrote: > It reserves and disallows imports on any "MODULE_${name}" namespace, > while it implicitly adds the same namespace to every module. Ah nice. This is pretty similar to what I want and had badly prototyped a while ago. > This allows

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-22 Thread Christoph Hellwig
On Tue, Oct 22, 2024 at 10:29:13AM -0700, Andrii Nakryiko wrote: > > > > Would this work? > > > > #define SRCU_INVALID_INDEX -1 > > > > But why? Becaue it very clearly documents what is going on. >It's a nice property to have an int-returning API where valid > values are only >= 0, so callers ar

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-22 Thread Christoph Hellwig
On Tue, Oct 22, 2024 at 09:10:18AM +0200, Peter Zijlstra wrote: > Ah, well, the thing that got us here is that we (Andrii and me) wanted > to use -1 as an 'invalid' value to indicate SRCU is not currently in > use. > > So it all being int is really rather convenient :-) Then please document that

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-22 Thread Christoph Hellwig
On Tue, Oct 22, 2024 at 09:06:35AM +0200, Peter Zijlstra wrote: > What is returned is an array index -- and SRCU is currently built using > an array of size 2. Using larger arrays is conceivable (IIRC some > versions of preemptible RCU used up to 4 or something). > > So while the values 0,1 are po

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Christoph Hellwig
On Mon, Oct 21, 2024 at 03:13:05PM -0700, Paul E. McKenney wrote: > For almost 20 years, the int return value from srcu_read_lock() has > been always either zero or one. This commit therefore documents the > fact that it will be non-negative. If it is always zero or one, wouldn't bool the better

Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-19 Thread Christoph Hellwig
On Wed, Sep 18, 2024 at 09:18:43AM +0200, Linus Torvalds wrote: > On Tue, 17 Sept 2024 at 16:34, Boqun Feng wrote: > > > > This series introduces hazard pointers [1] to kernel space. A TL;DR > > description of hazard pointers is "a scalable refcounting mechanim > > with RCU-like API". More informa

Re: [RFC 7/7] vhost: Add new UAPI to support changing Kthread mode

2024-08-25 Thread Christoph Hellwig
On Mon, Aug 26, 2024 at 02:21:52PM +0800, Jason Wang wrote: > > What is the application visible behavior that the API use is the proxy > > for? > > Vhost used to be created by kthreadd but some recent patches change it > to behave like being froked by the owner. So the various attributes > that in

Re: [PATCH v3 1/2] Introduce klp_ops into klp_func structure

2024-08-24 Thread Christoph Hellwig
On Thu, Aug 22, 2024 at 11:01:58AM +0800, Wardenjohn wrote: > 1. Move klp_ops into klp_func structure. > Rewrite the logic of klp_find_ops and > other logic to get klp_ops of a function. > > 2. Move definition of struct klp_ops into > include/linux/livepatch.h Why?

Re: [RFC 7/7] vhost: Add new UAPI to support changing Kthread mode

2024-08-20 Thread Christoph Hellwig
On Mon, Aug 19, 2024 at 05:27:33PM +0800, Cindy Lu wrote: > Add a new UAPI to support setting the vhost device to > use kthread mode. The user space application needs to use > VHOST_SET_USE_KTHREAD to set the mode. This setting must > be set before VHOST_SET_OWNER is set. Usage of an API is a comp

Re: [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases

2024-07-31 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: Current status and possible improvements in CONFIG_MODULE_FORCE_UNLOAD

2024-06-07 Thread Christoph Hellwig
On Thu, Jun 06, 2024 at 06:49:59AM +, Aditya Garg wrote: > Hi > > I am Aditya Garg. I often require using out of tree drivers to support > various hardwares on Linux. Just stop buying hardwarew that requires this, or improve and upstream the drivers to make your life easier instead of making

Re: [PATCH] mm: Remove mm argument from mm_get_unmapped_area()

2024-05-06 Thread Christoph Hellwig
On Mon, May 06, 2024 at 09:07:47AM -0700, Rick Edgecombe wrote: > if (flags & MAP_FIXED) { > /* Ok, don't mess with it. */ > - return mm_get_unmapped_area(current->mm, NULL, orig_addr, len, > pgoff, flags); > + return current_get_unmapped_area(NULL, orig

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH] vduse: implement DMA sync callbacks

2024-02-23 Thread Christoph Hellwig
On Thu, Feb 22, 2024 at 03:29:10PM -0500, Michael S. Tsirkin wrote: > In a sense ... but on the other hand, the "fake DMA" metaphor seems to > work surprisingly well, like in this instance - internal bounce buffer > looks a bit like non-coherent DMA. A way to make this all prettier > would I guess

Re: [PATCH] vduse: implement DMA sync callbacks

2024-02-20 Thread Christoph Hellwig
On Mon, Feb 19, 2024 at 06:06:06PM +0100, Maxime Coquelin wrote: > Since commit 295525e29a5b ("virtio_net: merge dma > operations when filling mergeable buffers"), VDUSE device > require support for DMA's .sync_single_for_cpu() operation > as the memory is non-coherent between the device and CPU >

Re: [PATCH v1] module.h: define __symbol_get_gpl() as a regular __symbol_get()

2024-02-01 Thread Christoph Hellwig
On Thu, Feb 01, 2024 at 12:29:46PM +0300, Andrew Kanner wrote: > Of course not, no new users needed. > > I haven't discussed it directly. I found the unused __symbol_get_gpl() > myself, but during investigation of wether it was ever used somewhere > found the old patch series suggested by Mauro Ca

Re: [PATCH v1] module.h: define __symbol_get_gpl() as a regular __symbol_get()

2024-01-31 Thread Christoph Hellwig
> EXPORT_SYMBOL_GPL modules") Christoph Hellwig switched __symbol_get() > to process GPL symbols only, most likely this is what > __symbol_get_gpl() was designed to do. > > We might either define __symbol_get_gpl() as __symbol_get() or remove > it completely as suggested by M

Re: [PATCH 5/5] modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules

2023-10-17 Thread Christoph Hellwig
On Wed, Oct 18, 2023 at 01:30:18AM +0100, David Woodhouse wrote: > > But if we're going to tolerate the core kernel still exporting some > stuff with EXPORT_SYMBOL, why isn't OK for a GPL-licensed module do to > the same? Even an *in-tree* GPL-licensed module now can't export > functionality with

Re: [PATCH] module: Add CONFIG_MODULE_LOAD_IN_SEQUENCE option

2023-10-10 Thread Christoph Hellwig
On Mon, Oct 09, 2023 at 10:26:35AM +0530, Joey Jiao wrote: > When modprobe cmds are executed one by one, the final loaded modules > are not in fixed sequence as expected. And why does this matter? If this is important enough to matter it should just be the default, and have really good reason for

Re: [PATCH] net: appletalk: remove cops support

2023-09-27 Thread Christoph Hellwig
; needed and actually used by anyone, we can add it back later once the > license is cleared up. Looks good: Acked-by: Christoph Hellwig

Re: SPDX: Appletalk FW license in the kernel

2023-09-26 Thread Christoph Hellwig
On Fri, Sep 15, 2023 at 09:39:05AM -0400, Prarit Bhargava wrote: > To be clear, I am not asking for their removal, however, I do think a better > license should be issued for these files. The files were trivially modified > in 2006. It could be that the code in question is now unused and it is jus

[PATCH 11/19] fs: add new shutdown_sb and free_sb methods

2023-09-13 Thread Christoph Hellwig
ere generic_shutdown_super is called by the core code, and there are extra ->shutdown_sb and ->free_sb hooks before and after it. To remove the amount of boilerplate code ->shutdown_sb is only called if the super has finished initialization and ->d_root is set. Signed-off-by: Ch

[PATCH 09/19] zonefs: remove duplicate cleanup in zonefs_fill_super

2023-09-13 Thread Christoph Hellwig
When ->fill_super fails, ->kill_sb is called which already cleans up the inodes and zgroups. Drop the extra cleanup code in zonefs_fill_super. Signed-off-by: Christoph Hellwig --- fs/zonefs/super.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --gi

[PATCH 02/19] fs: make ->kill_sb optional

2023-09-13 Thread Christoph Hellwig
Call generic_shutdown_super if ->kill_sb is not provided by the file system. This can't currently happen but will become common soon. Signed-off-by: Christoph Hellwig --- fs/super.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super

[PATCH 10/19] USB: gadget/legacy: remove sb_mutex

2023-09-13 Thread Christoph Hellwig
Creating new a new super_block vs freeing the old one for single instance file systems is serialized by the wait for SB_DEAD. Remove the superfluous sb_mutex. Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/legacy/inode.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers

[PATCH 14/19] jffs2: convert to ->shutdown_sb and ->free_sb

2023-09-13 Thread Christoph Hellwig
Convert jffs2 from ->kill_sb to ->shutdown_sb and ->free_sb. Drop the otherwise unused kill_mtd_super helpers, as there is no benefit in it over just calling put_mtd_device on sb->s_mtd. Signed-off-by: Christoph Hellwig --- drivers/mtd/mtdsuper.c| 12 fs/j

[PATCH 17/19] NFS: move nfs_kill_super to fs_context.c

2023-09-13 Thread Christoph Hellwig
nfs_kill_super is only used in fs_context, so move it there. Signed-off-by: Christoph Hellwig --- fs/nfs/fs_context.c | 13 + fs/nfs/internal.h | 1 - fs/nfs/super.c | 16 fs/nfs/sysfs.h | 2 ++ 4 files changed, 15 insertions(+), 17 deletions(-) diff

[PATCH 03/19] fs: release anon dev_t in deactivate_locked_super

2023-09-13 Thread Christoph Hellwig
ease the anon dev_t in deactivate_locked_super if the super_block was using one. As the freeing is done after the main call to kill_super_notify, this removes the need for having two slightly different call sites for it. Signed-off-by: Christoph Hellwig --- block/bdev.c

[PATCH 05/19] fs: assign an anon dev_t in common code

2023-09-13 Thread Christoph Hellwig
callback. Note that this now makes the set callback optional as a lot of file systems don't need it any more. Signed-off-by: Christoph Hellwig --- fs/9p/vfs_super.c | 2 +- fs/afs/super.c | 12 +++- fs/btrfs/super.c | 6 ++-- fs/ceph/super.c| 7 + fs/ecr

[PATCH 06/19] qibfs: use simple_release_fs

2023-09-13 Thread Christoph Hellwig
qibfs currently has convoluted code to allow registering HCAs while qibfs is not mounted and vice versa. Switch to using simple_release_fs every time an entry is added to pin the fs instance and remove all the boiler plate code. Signed-off-by: Christoph Hellwig --- drivers/infiniband/hw/qib

[PATCH 16/19] x86/resctrl: release rdtgroup_mutex and the CPU hotplug lock in rdt_shutdown_sb

2023-09-13 Thread Christoph Hellwig
ather complicated locking hierarchy. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 8db767fd80df6b..e87de5194

[PATCH 08/19] pstore: shrink the pstore_sb_lock critical section in pstore_kill_sb

2023-09-13 Thread Christoph Hellwig
gned-off-by: Christoph Hellwig --- fs/pstore/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 585360706b335f..fd1d24b47160d0 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -467,10 +467,9 @@ static struct dentry *p

[PATCH 13/19] fs: convert kill_block_super to block_free_sb

2023-09-13 Thread Christoph Hellwig
Replace kill_block_super with block_free_sb, which is wired up to the ->free_sb method. For file systems that wrapped kill_block_super, ->kill_sb is replaced with ->shutdown and ->free_sb methods as needed. Signed-off-by: Christoph Hellwig --- fs/adfs/super.c | 2 +- fs/

[PATCH 15/19] kernfs: split ->kill_sb

2023-09-13 Thread Christoph Hellwig
sb and ->free_sb to always be called in pairs, which it currently is. The next commit will try to clean this up. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 12 +--- fs/kernfs/mount.c | 18 -- fs/sysf

[PATCH 12/19] fs: convert kill_litter_super to litter_shutdown_sb

2023-09-13 Thread Christoph Hellwig
Replace kill_litter_super with litter_shutdown_sb, which is wired up to the ->shutdown_sb method. For file systems that wrapped kill_litter_super, ->kill_sb is replaced with ->shutdown and ->free_sb methods as needed. Signed-off-by: Christoph Hellwig --- arch/powerpc/platform

[PATCH 19/19] fs: remove ->kill_sb

2023-09-13 Thread Christoph Hellwig
Now that no instances are left, remove ->kill_sb and mark generic_shutdown_super static. Signed-off-by: Christoph Hellwig --- Documentation/filesystems/locking.rst | 5 - Documentation/filesystems/vfs.rst | 5 - fs/super.c|

[PATCH 01/19] fs: reflow deactivate_locked_super

2023-09-13 Thread Christoph Hellwig
Return early for the case where the super block isn't cleaned up to reduce level of indentation. Signed-off-by: Christoph Hellwig --- fs/super.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/fs/super.c b/fs/super.c index 2d762ce67

[PATCH 18/19] fs: simple ->shutdown_sb and ->free_sb conversions

2023-09-13 Thread Christoph Hellwig
Convert all file systems that just called generic_shutdown_super from ->kill_sb without any state kept from before the call to after it to ->shutdown_sb and ->free_sb as needed. Signed-off-by: Christoph Hellwig --- fs/9p/vfs_super.c | 14 +++--- fs/af

[PATCH 07/19] hypfs: use d_genocide to kill fs entries

2023-09-13 Thread Christoph Hellwig
hypfs is entirely synthetic and doesn't care about i_nlink when dropping entries from the cache. Switch to d_genocide instead of a home grown file remove loop for unmount and write (yes, really!). Signed-off-by: Christoph Hellwig --- arch/s390/hypfs/inode.c

[PATCH 04/19] NFS: remove the s_dev field from struct nfs_server

2023-09-13 Thread Christoph Hellwig
Don't duplicate the dev_t in the nfs_server structure given that it can be trivially retrieved from the super_block. Signed-off-by: Christoph Hellwig --- fs/nfs/client.c | 2 +- fs/nfs/nfs4proc.c | 8 fs/nfs/nfs4trace.h| 6 +++--- fs/nfs/nfs4

split up ->kill_sb

2023-09-13 Thread Christoph Hellwig
Hi Al and Christian, this series splits ->kill_sb into separate ->shutdown_sb and ->free_sb methods and then calls generic_shutdown_super from common code to clean up the file system shutdown interface. As a first step towards that it moves allocating and freeing the anonymous block device dev_t

Re: [PATCH v2] arch/cacheflush: Introduce flush_all_caches()

2022-08-21 Thread Christoph Hellwig
On Fri, Aug 19, 2022 at 10:10:24AM -0700, Davidlohr Bueso wrote: > index b192d917a6d0..ac4d4fd4e508 100644 > --- a/arch/x86/include/asm/cacheflush.h > +++ b/arch/x86/include/asm/cacheflush.h > @@ -10,4 +10,8 @@ > > void clflush_cache_range(void *addr, unsigned int size); > > +/* see comments i

Re: [PATCH v2] pmem: fix a name collision

2022-06-30 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH] pmem: fix a name collision

2022-06-30 Thread Christoph Hellwig
On Thu, Jun 30, 2022 at 11:51:55AM -0600, Jane Chu wrote: > -static phys_addr_t to_phys(struct pmem_device *pmem, phys_addr_t offset) > +static phys_addr_t _to_phys(struct pmem_device *pmem, phys_addr_t offset) I'd rather call this pmem_to_phys as that is a much nicer name.

Re: [PATCH] xfs: fail dax mount if reflink is enabled on a partition

2022-06-09 Thread Christoph Hellwig
On Thu, Jun 09, 2022 at 10:34:35PM +0800, Shiyang Ruan wrote: > Failure notification is not supported on partitions. So, when we mount > a reflink enabled xfs on a partition with dax option, let it fail with > -EINVAL code. Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCHSETS] v14 fsdax-rmap + v11 fsdax-reflink

2022-05-10 Thread Christoph Hellwig
The patch numbering due looks odd due to the combination of the two series. But otherwise this looks good to me modulo the one minor nitpick.

Re: [PATCH v11 06/07] xfs: support CoW in fsdax mode

2022-05-09 Thread Christoph Hellwig
ult(vmf, pe_size, pfn, NULL, > + (write_fault && !vmf->cow_page) ? > + &xfs_dax_write_iomap_ops : > + &xfs_read_iomap_ops); > +} > +#endif Is there any reason this is in xfs_iomap.c and not xfs_file.c? Otherwise the patch looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v13 0/7] fsdax: introduce fs query to support reflink

2022-04-20 Thread Christoph Hellwig
On Thu, Apr 21, 2022 at 02:35:02PM +1000, Dave Chinner wrote: > Sure, I'm not a maintainer and just the stand-in patch shepherd for > a single release. However, being unable to cleanly merge code we > need integrated into our local subsystem tree for integration > testing because a patch dependency

Re: [PATCH v13 7/7] fsdax: set a CoW flag when associate reflink mappings

2022-04-19 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v12 6/7] xfs: Implement ->notify_failure() for XFS

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 10:09:40AM -0700, Dan Williams wrote: > Yes, sounds like we're on the same page. I had mistakenly interpreted > "Hence these notifications need to be delayed until after the > filesystem is mounted" as something the producer would need to handle, > but yes, consumer is free

Re: [RFC PATCH] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2022-04-11 Thread Christoph Hellwig
On Mon, Apr 11, 2022 at 01:16:23AM +0800, Shiyang Ruan wrote: > diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c > index bd502957cfdf..72d9e69aea98 100644 > --- a/drivers/nvdimm/pmem.c > +++ b/drivers/nvdimm/pmem.c > @@ -359,7 +359,6 @@ static void pmem_release_disk(void *__pmem) >

Re: [PATCH v12 7/7] fsdax: set a CoW flag when associate reflink mappings

2022-04-10 Thread Christoph Hellwig
> + * Set or Update the page->mapping with FS_DAX_MAPPING_COW flag. > + * Return true if it is an Update. > + */ > +static inline bool dax_mapping_set_cow(struct page *page) > +{ > + if (page->mapping) { > + /* flag already set */ > + if (dax_mapping_is_cow(page->mapping

Re: [PATCH v12 6/7] xfs: Implement ->notify_failure() for XFS

2022-04-10 Thread Christoph Hellwig
t struct quotactl_ops xfs_quotactl_operations; > +extern const struct dax_holder_operations xfs_dax_holder_operations; This needs to be defined to NULL if at least one of CONFIG_FS_DAX or CONFIG_MEMORY_FAILURE is not set. Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v12 2/7] mm: factor helpers for memory_failure_dev_pagemap

2022-04-10 Thread Christoph Hellwig
> + unmap_and_kill(&to_kill, pfn, page->mapping, page->index, flags); > +unlock: > + dax_unlock_page(page, cookie); > + return 0; As the buildbot points out this should probably be a "return rc".

Re: [PATCH v12 1/7] dax: Introduce holder for dax_device

2022-04-10 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v11 7/8] xfs: Implement ->notify_failure() for XFS

2022-03-30 Thread Christoph Hellwig
On Wed, Mar 30, 2022 at 11:16:10PM +0800, Shiyang Ruan wrote: > > > +#if IS_ENABLED(CONFIG_MEMORY_FAILURE) && IS_ENABLED(CONFIG_FS_DAX) > > > > No real need for the IS_ENABLED. Also any reason to even build this > > file if the options are not set? It seems like > > xfs_dax_holder_operations sho

Re: [PATCH v11 1/8] dax: Introduce holder for dax_device

2022-03-30 Thread Christoph Hellwig
On Wed, Mar 30, 2022 at 06:58:21PM +0800, Shiyang Ruan wrote: > As the code I pasted before, pmem driver will subtract its ->data_offset, > which is byte-based. And the filesystem who implements ->notify_failure() > will calculate the offset in unit of byte again. > > So, leave its function signat

Re: [PATCH v11 1/8] dax: Introduce holder for dax_device

2022-03-30 Thread Christoph Hellwig
On Wed, Mar 30, 2022 at 06:03:01PM +0800, Shiyang Ruan wrote: > > Because I am not sure if the offset between each layer is page aligned. For > example, when pmem dirver handles ->memory_failure(), it should subtract its > ->data_offset when it calls dax_holder_notify_failure(). If they aren't,

Re: [PATCH v6 3/6] mm: rmap: introduce pfn_mkclean_range() to cleans PTEs

2022-03-30 Thread Christoph Hellwig
On Wed, Mar 30, 2022 at 03:31:37PM +0800, Muchun Song wrote: > I saw Shiyang is ready to rebase onto this patch. So should I > move it to linux/mm.h or let Shiyang does? Good question. I think Andrew has this series in -mm and ready to go to Linus, so maybe it is best if we don't change too much

Re: [PATCH v11 7/8] xfs: Implement ->notify_failure() for XFS

2022-03-29 Thread Christoph Hellwig
> @@ -1892,6 +1893,8 @@ xfs_free_buftarg( > list_lru_destroy(&btp->bt_lru); > > blkdev_issue_flush(btp->bt_bdev); > + if (btp->bt_daxdev) > + dax_unregister_holder(btp->bt_daxdev, btp->bt_mount); > fs_put_dax(btp->bt_daxdev); > > kmem_free(btp); > @@ -193

Re: [PATCH v11 6/8] mm: Introduce mf_dax_kill_procs() for fsdax case

2022-03-29 Thread Christoph Hellwig
formed a reverse mapping from the storage address to the file and file offset. Otherwise looks good: Reviewed-by: Christoph Hellwig > index 9b1d56c5c224..0420189e4788 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -3195,6 +3195,10 @@ enum mf_flags { >

Re: [PATCH v6 3/6] mm: rmap: introduce pfn_mkclean_range() to cleans PTEs

2022-03-29 Thread Christoph Hellwig
On Tue, Mar 29, 2022 at 09:48:50PM +0800, Muchun Song wrote: > + * * Return the start of user virtual address at the specific offset within Double "*" here. Also Shiyang has been wanting a quite similar vma_pgoff_address for use in dax.c. Maybe we'll need to look into moving this to linux/mm.h.

Re: [PATCH v11 5/8] mm: move pgoff_address() to vma_pgoff_address()

2022-03-29 Thread Christoph Hellwig
On Sun, Feb 27, 2022 at 08:07:44PM +0800, Shiyang Ruan wrote: > Since it is not a DAX-specific function, move it into mm and rename it > to be a generic helper. FYI, there is a patch in -mm and linux-next: "mm: rmap: introduce pfn_mkclean_range() to cleans PTEs" that adds a vma_pgoff_address w

Re: [PATCH v11 1/8] dax: Introduce holder for dax_device

2022-03-29 Thread Christoph Hellwig
On Wed, Mar 16, 2022 at 09:46:07PM +0800, Shiyang Ruan wrote: > > Forgive me if this has been discussed before, but since dax_operations > > are in terms of pgoff and nr pages and memory_failure() is in terms of > > pfns what was the rationale for making the function signature byte > > based? > >

Re: [PATCH v11 1/8] dax: Introduce holder for dax_device

2022-03-29 Thread Christoph Hellwig
On Fri, Mar 11, 2022 at 03:35:13PM -0800, Dan Williams wrote: > > + if (!dax_dev->holder_ops) { > > + rc = -EOPNOTSUPP; > > I think it is ok to return success (0) for this case. All the caller > of dax_holder_notify_failure() wants to know is if the notification > was successfu

Re: [PATCH v5 5/6] dax: fix missing writeprotect the pte entry

2022-03-22 Thread Christoph Hellwig
n the only caller below? Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v5 6/6] mm: simplify follow_invalidate_pte()

2022-03-22 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v5 2/6] dax: fix cache flush on PMD-mapped pages

2022-03-22 Thread Christoph Hellwig
92576f1167c ("dax: does not work correctly with virtual aliasing > caches") > > Fixes: f729c8c9b24f ("dax: wrprotect pmd_t in dax_mapping_entry_mkclean") > Signed-off-by: Muchun Song > Reviewed-by: Dan Williams Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v5 1/6] mm: rmap: fix cache flush on THP pages

2022-03-22 Thread Christoph Hellwig
by: Dan Williams Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH] dax: make sure inodes are flushed before destroy cache

2022-02-14 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v10 4/9] fsdax: fix function description

2022-02-02 Thread Christoph Hellwig
Dan, can you send this to Linus for 5.17 to get it out of the queue?

Re: [PATCH v10 1/9] dax: Introduce holder for dax_device

2022-02-02 Thread Christoph Hellwig
On Thu, Jan 27, 2022 at 08:40:50PM +0800, Shiyang Ruan wrote: > +void dax_register_holder(struct dax_device *dax_dev, void *holder, > + const struct dax_holder_operations *ops) > +{ > + if (!dax_alive(dax_dev)) > + return; > + > + dax_dev->holder_data = holder; > +

Re: [PATCH 4/5] dax: fix missing writeprotect the pte entry

2022-01-23 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 03:55:14PM +0800, Muchun Song wrote: > Reuse some infrastructure of page_mkclean_one() to let DAX can handle > similar case to fix this issue. Can you split out some of the infrastructure changes into proper well-documented preparation patches? > + pgoff_t pgoff_end =

Re: [PATCH 3/5] mm: page_vma_mapped: support checking if a pfn is mapped into a vma

2022-01-23 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 03:55:13PM +0800, Muchun Song wrote: > + if (pvmw->pte && ((pvmw->flags & PVMW_PFN_WALK) || > !PageHuge(pvmw->page))) Please avoid the overly long line here and in a few other places. > +/* > + * Then at what user virtual address will none of the page be found in vma?

Re: [PATCH 2/5] dax: fix cache flush on PMD-mapped pages

2022-01-23 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 03:55:12PM +0800, Muchun Song wrote: > The flush_cache_page() only remove a PAGE_SIZE sized range from the cache. > However, it does not cover the full pages in a THP except a head page. > Replace it with flush_cache_range() to fix this issue. > > Fixes: f729c8c9b24f ("dax:

Re: [PATCH 1/5] mm: rmap: fix cache flush on THP pages

2022-01-23 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 03:55:11PM +0800, Muchun Song wrote: > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/rmap.c b/mm/rmap.c > index b0fd9dc19eba..65670cb805d6 100644 > --- a/mm/rmap.c > +++ b/mm/rmap.c > @@ -974,7 +974,7 @@ static bool page_mkclean_one(struct page *page, s

Re: [PATCH v9 02/10] dax: Introduce holder for dax_device

2022-01-20 Thread Christoph Hellwig
On Thu, Jan 20, 2022 at 06:22:00PM -0800, Darrick J. Wong wrote: > Hm, so that means XFS can only support dax+pmem when there aren't > partitions in use? Ew. Yes. Or any sensible DAX usage going forward for that matter. > > > > (2) extent the holder mechanism to cover a rangeo > > I don't t

Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2022-01-20 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 10:33:58AM +0800, Shiyang Ruan wrote: > > > > But different question, how does this not conflict with: > > > > #define PAGE_MAPPING_ANON 0x1 > > > > in page-flags.h? > > Now we are treating dax pages, so I think its flags should be different from > normal page. In

Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2022-01-20 Thread Christoph Hellwig
On Sun, Dec 26, 2021 at 10:34:39PM +0800, Shiyang Ruan wrote: > +#define FS_DAX_MAPPING_COW 1UL > + > +#define MAPPING_SET_COW(m) (m = (struct address_space *)FS_DAX_MAPPING_COW) > +#define MAPPING_TEST_COW(m) (((unsigned long)m & FS_DAX_MAPPING_COW) == \ > +

Re: [PATCH v9 08/10] mm: Introduce mf_dax_kill_procs() for fsdax case

2022-01-20 Thread Christoph Hellwig
Please only build the new DAX code if CONFIG_FS_DAX is set.

Re: [PATCH v9 07/10] mm: move pgoff_address() to vma_pgoff_address()

2022-01-20 Thread Christoph Hellwig
On Sun, Dec 26, 2021 at 10:34:36PM +0800, Shiyang Ruan wrote: > Since it is not a DAX-specific function, move it into mm and rename it > to be a generic helper. > > Signed-off-by: Shiyang Ruan Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v9 05/10] fsdax: fix function description

2022-01-20 Thread Christoph Hellwig
On Sun, Dec 26, 2021 at 10:34:34PM +0800, Shiyang Ruan wrote: > The function name has been changed, so the description should be updated > too. > > Signed-off-by: Shiyang Ruan Looks good, Reviewed-by: Christoph Hellwig Dan, can you send this to Linux for 5.17 so that we can get i

Re: [PATCH v9 02/10] dax: Introduce holder for dax_device

2022-01-20 Thread Christoph Hellwig
On Wed, Jan 05, 2022 at 04:12:04PM -0800, Dan Williams wrote: > We ended up with explicit callbacks after hch balked at a notifier > call-chain, but I think we're back to that now. The partition mistake > might be unfixable, but at least bdev_dax_pgoff() is dead. Notifier > call chains have their o

Re: [PATCH v8 7/9] dax: add dax holder helper for filesystems

2021-12-15 Thread Christoph Hellwig
On Wed, Dec 15, 2021 at 10:21:00AM +0800, Shiyang Ruan wrote: > > > 在 2021/12/14 23:47, Christoph Hellwig 写道: > > On Thu, Dec 02, 2021 at 04:48:54PM +0800, Shiyang Ruan wrote: > > > Add these helper functions, and export them for filesystem use. > > > &g

Re: [PATCH v8 1/9] dax: Use percpu rwsem for dax_{read,write}_lock()

2021-12-15 Thread Christoph Hellwig
On Wed, Dec 15, 2021 at 10:06:29AM +0800, Shiyang Ruan wrote: > > > 在 2021/12/14 23:40, Christoph Hellwig 写道: > > On Thu, Dec 02, 2021 at 04:48:48PM +0800, Shiyang Ruan wrote: > > > In order to introduce dax holder registration, we need a write lock for > > >

Re: [PATCH v8 8/9] xfs: Implement ->notify_failure() for XFS

2021-12-14 Thread Christoph Hellwig
> + // TODO check and try to fix metadata Please avoid //-style comments. > +static u64 > +xfs_dax_ddev_offset( > + struct xfs_mount*mp, > + struct dax_device *dax_dev, > + u64 disk_offset) > +{ > + xfs_buftarg_t *targp; > + > + if

Re: [PATCH v8 7/9] dax: add dax holder helper for filesystems

2021-12-14 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 04:48:54PM +0800, Shiyang Ruan wrote: > Add these helper functions, and export them for filesystem use. What is the point of adding these wrappers vs just calling the underlying functions?

  1   2   3   4   5   6   7   8   9   10   >