[PATCH 08/10] MIPS: disable CONFIG_IDE in malta*_defconfig

2021-03-17 Thread Christoph Hellwig
Various malta defconfigs enable CONFIG_IDE for the tc86c001 ide driver, hich is a Toshiba plug in card that does not make much sense to use on bigsur platforms. For all other ATA cards libata support is already enabled. Signed-off-by: Christoph Hellwig --- arch/mips/configs/malta_kvm_defconfig

[PATCH 07/10] MIPS: disable CONFIG_IDE in bigsur_defconfig

2021-03-17 Thread Christoph Hellwig
bigsur_defconfig enables CONFIG_IDE for the tc86c001 ide driver, which is a Toshiba plug in card that does not make much sense to use on bigsur platforms. For all other ATA cards libata support is already enabled. Signed-off-by: Christoph Hellwig --- arch/mips/configs/bigsur_defconfig | 4

[PATCH 06/10] MIPS: disable CONFIG_IDE in rbtx49xx_defconfig

2021-03-17 Thread Christoph Hellwig
rbtx49xx_defconfig enables CONFIG_IDE for the tx4938 and tx4939 ide drivers, but those aren't actually used by the last known remaining user: https://lore.kernel.org/lkml/20210107.101729.1936921832901251107.an...@mba.ocn.ne.jp/ Signed-off-by: Christoph Hellwig --- arch/mips/configs

[PATCH 05/10] MIPS: switch workpad_defconfig from legacy IDE to libata

2021-03-17 Thread Christoph Hellwig
Use libata instead of the deprecated legacy ide driver in workpad_defconfig. Signed-off-by: Christoph Hellwig --- arch/mips/configs/workpad_defconfig | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs

[PATCH 04/10] MIPS: disable CONFIG_IDE in sb1250_swarm_defconfig

2021-03-17 Thread Christoph Hellwig
sb1250_swarm_defconfig enables CONFIG_IDE but no actual host controller driver, so just drop CONFIG_IDE, CONFIG_BLK_DEV_IDECD and CONFIG_BLK_DEV_IDETAPE as they are useless. Signed-off-by: Christoph Hellwig --- arch/mips/configs/sb1250_swarm_defconfig | 3 --- 1 file changed, 3 deletions

[PATCH 03/10] ARM: disable CONFIG_IDE in pxa_defconfig

2021-03-17 Thread Christoph Hellwig
pxa_defconfig already enables libata including the pata_pcmcia driver, so drop the legacy ide driver and idecs host driver. Signed-off-by: Christoph Hellwig --- arch/arm/configs/pxa_defconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs

[PATCH 02/10] ARM: disable CONFIG_IDE in footbridge_defconfig

2021-03-17 Thread Christoph Hellwig
footbridge_defconfig enables CONFIG_IDE but no actual host controller driver, so just drop it. Signed-off-by: Christoph Hellwig --- arch/arm/configs/footbridge_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/configs/footbridge_defconfig b/arch/arm/configs

[PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-17 Thread Christoph Hellwig
Switch the alpha defconfig from the legacy ide driver to libata. Signed-off-by: Christoph Hellwig --- arch/alpha/configs/defconfig | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/alpha/configs/defconfig b/arch/alpha/configs/defconfig index 724c4075df408e

remove the legacy ide driver

2021-03-17 Thread Christoph Hellwig
Hi all, we've been trying to get rid of the legacy ide driver for a while now, and finally scheduled a removal for 2021, which is three month old now. In general distros and most defconfigs have switched to libata long ago, but there are a few exceptions. This series first switches over all

Re: kmap_local semantics

2021-03-17 Thread Christoph Hellwig
On Wed, Mar 17, 2021 at 07:44:20PM -0700, Ira Weiny wrote: > Agreed. I'm Sorry, I did not word the above clearly enough. Let me rephrase > that. > > Christoph, do you anticipate additional need to call kmap and hand the > mappings > to other threads? If not then kmap_local is what you should

Re: [PATCH v4 00/25] Page folios

2021-03-17 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 07:40:14PM +, Matthew Wilcox wrote: > The reason I didn't go with 'head' is that traditionally 'head' implies > that there are tail pages. It would be weird to ask 'if (HeadHead(head))' > That's currently spelled 'if (FolioMulti(folio))'. But it can be changed > if

Re: [PATCH v4 25/25] cachefiles: Switch to wait_page_key

2021-03-17 Thread Christoph Hellwig
On Fri, Mar 05, 2021 at 04:19:01AM +, Matthew Wilcox (Oracle) wrote: > Cachefiles was relying on wait_page_key and wait_bit_key being the > same layout, which is fragile. Now that wait_page_key is exposed in > the pagemap.h header, we can remove that fragility. Also switch it > to use the

Re: [PATCH v4 20/25] mm/filemap: Convert wait_on_page_bit to wait_on_folio_bit

2021-03-17 Thread Christoph Hellwig
> + if (FolioWriteback(folio) && > + wait_on_folio_bit_killable(folio, PG_writeback) < 0) > return VM_FAULT_RETRY; This really screams for a proper wait_on_page_writeback_killable helper rather than hardcoding the PG_* bit in a random file system. It also seems to have

Re: [PATCH v4 15/25] mm/filemap: Convert lock_page_async to lock_folio_async

2021-03-17 Thread Christoph Hellwig
On Fri, Mar 05, 2021 at 04:18:51AM +, Matthew Wilcox (Oracle) wrote: > There aren't any actual callers of lock_page_async(), but convert > filemap_update_page() to call __lock_folio_async(). So please just kill lock_page_async first and mark __lock_page_async static. Then only update

Re: [PATCH v4 10/25] mm/util: Add folio_mapping and folio_file_mapping

2021-03-17 Thread Christoph Hellwig
> +struct address_space *page_mapping(struct page *); > +struct address_space *folio_mapping(struct folio *); > +struct address_space *__folio_file_mapping(struct folio *); > + > +static inline struct address_space *folio_file_mapping(struct folio *folio) > +{ > + if

Re: [PATCH v4 09/25] mm: Add folio_index, folio_page and folio_contains

2021-03-17 Thread Christoph Hellwig
On Sat, Mar 13, 2021 at 12:37:16PM -0800, Andrew Morton wrote: > On Fri, 5 Mar 2021 04:18:45 + "Matthew Wilcox (Oracle)" > wrote: > > > folio_index() is the equivalent of page_index() for folios. folio_page() > > finds the page in a folio for a page cache index. folio_contains() > >

Re: [PATCH v4 08/25] mm: Handle per-folio private data

2021-03-17 Thread Christoph Hellwig
> +static inline void attach_page_private(struct page *page, void *data) > +{ > + attach_folio_private((struct folio *)page, data); > +} > + > +static inline void *detach_page_private(struct page *page) > +{ > + return detach_folio_private((struct folio *)page); > +} I hate these open

Re: [PATCH v4 03/25] mm/vmstat: Add functions to account folio statistics

2021-03-17 Thread Christoph Hellwig
> +static inline > +void __inc_zone_folio_stat(struct folio *folio, enum zone_stat_item item) This prototype style is weird and doesn't follow either of the preffered styles.. > static inline void __mod_zone_freepage_state(struct zone *zone, int nr_pages, >

Re: [PATCH v4 01/25] mm: Introduce struct folio

2021-03-17 Thread Christoph Hellwig
On Fri, Mar 05, 2021 at 04:18:37AM +, Matthew Wilcox (Oracle) wrote: > +/* > + * A struct folio is either a base (order-0) page or the head page of > + * a compound page. > + */ Hmm. While that comment seems to be true I'm not sure it is the essence. Maybe it should be more framed in terms

Re: [PATCH 2/3] media/videobuf1|2: Mark follow_pfn usage as unsafe

2021-03-17 Thread Christoph Hellwig
On Tue, Mar 16, 2021 at 04:52:44PM +0100, Daniel Vetter wrote: > My understanding is mostly, but with some objections. And I kinda > don't want to let this die in a bikeshed and then not getting rid of > follow_pfn as a result. There's enough people who acked this, and the > full removal got some

Re: [PATCH 2/3] media/videobuf1|2: Mark follow_pfn usage as unsafe

2021-03-16 Thread Christoph Hellwig
On Tue, Mar 16, 2021 at 04:33:02PM +0100, Daniel Vetter wrote: > The media model assumes that buffers are all preallocated, so that > when a media pipeline is running we never miss a deadline because the > buffers aren't allocated or available. > > This means we cannot fix the v4l follow_pfn

Re: [PATCH v7 3/3] dm: add DM_INTERPOSED_FLAG

2021-03-16 Thread Christoph Hellwig
On Tue, Mar 16, 2021 at 03:23:14PM +, Christoph Hellwig wrote: > On Mon, Mar 15, 2021 at 04:25:09PM +0300, Sergei Shtepa wrote: > > The 03/14/2021 12:30, Christoph Hellwig wrote: > > > On Fri, Mar 12, 2021 at 06:44:55PM +0300, Sergei Shtepa wrote: > > > > DM_INTE

Re: [PATCH v7 3/3] dm: add DM_INTERPOSED_FLAG

2021-03-16 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 04:25:09PM +0300, Sergei Shtepa wrote: > The 03/14/2021 12:30, Christoph Hellwig wrote: > > On Fri, Mar 12, 2021 at 06:44:55PM +0300, Sergei Shtepa wrote: > > > DM_INTERPOSED_FLAG allow to create DM targets on "the fly". > > > Underly

Re: [PATCH -next 1/5] block: add disk sequence number

2021-03-16 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 08:18:24PM +, Matthew Wilcox wrote: > On Mon, Mar 15, 2021 at 09:02:38PM +0100, Matteo Croce wrote: > > From: Matteo Croce > > > > Add a sequence number to the disk devices. This number is put in the > > uevent so userspace can correlate events when a driver reuses a

Re: [RFC PATCH v2 07/11] dma-mapping: Add flags to dma_map_ops to indicate PCI P2PDMA support

2021-03-16 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:31:37PM -0700, Logan Gunthorpe wrote: > +int dma_pci_p2pdma_supported(struct device *dev) > +{ > + const struct dma_map_ops *ops = get_dma_ops(dev); > + > + return !ops || ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED; > +} > +EXPORT_SYMBOL(dma_pci_p2pdma_supported);

Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_p2pdma_should_map_bus() and pci_p2pdma_bus_offset()

2021-03-16 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote: > Introduce pci_p2pdma_should_map_bus() which is meant to be called by > DMA map functions to determine how to map a given p2pdma page. > > pci_p2pdma_bus_offset() is also added to allow callers to get the bus > offset if they need

Re: [RFC PATCH v2 06/11] dma-direct: Support PCI P2PDMA pages in dma-direct map_sg

2021-03-16 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:31:36PM -0700, Logan Gunthorpe wrote: > for_each_sg(sgl, sg, nents, i) { > + if (is_pci_p2pdma_page(sg_page(sg))) { > + if (sg_page(sg)->pgmap != pgmap) { > + pgmap = sg_page(sg)->pgmap; > +

Re: [RFC PATCH v2 09/11] block: Add BLK_STS_P2PDMA

2021-03-16 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:31:39PM -0700, Logan Gunthorpe wrote: > Create a specific error code for when P2PDMA pages are passed to a block > devices that cannot map them (due to no IOMMU support or ACS protections). > > This makes request errors in these cases more informative of as to what >

Re: [RFC PATCH v2 07/11] dma-mapping: Add flags to dma_map_ops to indicate PCI P2PDMA support

2021-03-16 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 10:33:13AM -0600, Logan Gunthorpe wrote: > >> + return !ops || ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED; > > > > Is this logic correct? I would have expected. > > > > return (ops && ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED); > > > If ops is NULL then the operations

Re: [RFC PATCH v2 06/11] dma-direct: Support PCI P2PDMA pages in dma-direct map_sg

2021-03-16 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 11:27:46AM -0700, Logan Gunthorpe wrote: > So then we reject the patches that make that change. Seems like an odd > argument to say that we can't do something that won't cause problems > because someone might use it as an example and do something that will > cause problems.

Re: [RFC PATCH v2 06/11] dma-direct: Support PCI P2PDMA pages in dma-direct map_sg

2021-03-16 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 06:11:17PM +, Robin Murphy wrote: > Sure, that's how things stand immediately after this patch. But then > someone comes along with the perfectly reasonable argument for returning > more expressive error information for regular mapping failures as well > (because

Re: [PATCHv3 2/6] arm64: don't use GENERIC_IRQ_MULTI_HANDLER

2021-03-15 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 11:56:25AM +, Mark Rutland wrote: > From: Marc Zyngier > > In subsequent patches we want to allow irqchip drivers to register as > FIQ handlers, with a set_handle_fiq() function. To keep the IRQ/FIQ > paths similar, we want arm64 to provide both set_handle_irq() and >

Re: arm64: kernel/sys.c - silence initialization warnings.

2021-03-15 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 11:14:34AM +, Catalin Marinas wrote: > We do similar initialisation in arch/arm64/kernel/sys32.c and > arch/arm64/kernel/traps.c for example. It's a pretty common pattern > throughout the kernel. > > So we either treat W=1 output as diff against the vanilla kernel when

Re: [PATCH v4 00/25] Page folios

2021-03-15 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 01:38:04PM +0100, Michal Hocko wrote: > I tend to agree here as well. The level compoud_head has spread out > silently is just too large. There are people coming up with all sorts of > optimizations to workaround that, and they are quite right that this is > somehing worth

Re: [PATCH v4 6/6] media: uvcvideo: Use dma_alloc_noncontiguous API

2021-03-15 Thread Christoph Hellwig
Thanks, with all the reviews in I've applied the series to the dma-mapping tree for 5.13. This will eventually become a stable baseline branch for the v4l work and the mips drm driver that needs dma_mmap_pages, but I'd like to wait a bit for any issues to pop up in linux-next first.

Re: [PATCH] include: fix inconsistent indenting in dma_alloc_coherent()

2021-03-15 Thread Christoph Hellwig
I've applied this to the dma-mapping tree with a more useful commit log.

Re: [PATCH v6 8/8] nouveau/svm: Implement atomic SVM access

2021-03-15 Thread Christoph Hellwig
> - /*XXX: atomic? */ > - return (fa->access == 0 || fa->access == 3) - > -(fb->access == 0 || fb->access == 3); > + /* Atomic access (2) has highest priority */ > + return (-1*(fa->access == 2) + (fa->access == 0 || fa->access == 3)) - > +(-1*(fb->access ==

Re: [PATCH v6 5/8] mm: Device exclusive memory access

2021-03-15 Thread Christoph Hellwig
} Should the trylock_page go into try_to_protect to simplify the loop a little? Also I wonder if we need make_device_exclusive_range or should just open code the get_user_pages_remote + try_to_protect loop in the callers, as that might allow them to also deduct other information about the found pages. Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v4 6/6] media: uvcvideo: Use dma_alloc_noncontiguous API

2021-03-15 Thread Christoph Hellwig
On Mon, Mar 15, 2021 at 08:30:57AM +0100, Ricardo Ribalda wrote: > Hi Christoph > > I guess you can merge this patch from your tree. I hope it is not too > late in this release cycle. The timing is perfectly fine, I haven't even started the dma-mapping tree for v5.13 yet.

Re: [PATCH v6 3/8] mm/rmap: Split try_to_munlock from try_to_unmap

2021-03-15 Thread Christoph Hellwig
bell > > --- > > Christoph - I didn't add your Reviewed-by from v3 because removal of the > extra VM_LOCKED check in v4 changed things slightly. Let me know if > you're still ok for me to add it. Thanks. Still looks good to me: Reviewed-by: Christoph Hellwig

Re: [PATCH v6 1/8] mm: Remove special swap entry functions

2021-03-15 Thread Christoph Hellwig
og should mention pfn_swap_entry_to_page() now. Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH v7 3/3] dm: add DM_INTERPOSED_FLAG

2021-03-14 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 06:44:55PM +0300, Sergei Shtepa wrote: > DM_INTERPOSED_FLAG allow to create DM targets on "the fly". > Underlying block device opens without a flag FMODE_EXCL. > DM target receives bio from the original device via > bdev_interposer. This is more of a philopical comment,

Re: [PATCH v7 2/3] block: add bdev_interposer

2021-03-14 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 06:44:54PM +0300, Sergei Shtepa wrote: > bdev_interposer allows to redirect bio requests to another devices. I think this warrants a somewhat more detailed description. The code itself looks pretty good to me now, a bunch of nitpicks and a question below: > +static

Re: [PATCH v7 1/3] block: add blk_mq_is_queue_frozen()

2021-03-14 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 02:06:41PM -0500, Mike Snitzer wrote: > This is returning a frozen state that is immediately stale. I don't > think any code calling this is providing the guarantees you think it > does due to the racey nature of this state once the mutex is dropped. The code only uses it

[GIT PULL] configfs fix for 5.12

2021-03-12 Thread Christoph Hellwig
The following changes since commit a74e6a014c9d4d4161061f770c9b4f98372ac778: Merge tag 's390-5.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (2021-03-10 13:15:16 -0800) are available in the Git repository at: git://git.infradead.org/users/hch/configfs.git

Re: [PATCH 27/30] scsi: myrs: Remove a couple of unused 'status' variables

2021-03-12 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 24/30] scsi: a100u2w: Remove unused variable 'bios_phys'

2021-03-12 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 09:47:32AM +, Lee Jones wrote: > Fixes the following W=1 kernel build warning(s): Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent

2021-03-12 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:12:55PM +, Paul Cercueil wrote: > ret = dma_mmap_pages(cma_obj->base.dev->dev, > vma, vma->vm_end - vma->vm_start, > virt_to_page(cma_obj->vaddr)); > > It works fine. > > I think I can use remap_pfn_range() for now, and

Re: [PATCH 23/30] scsi: initio: Remove unused variable 'prev'

2021-03-12 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 2/2] devtmpfs: actually reclaim some init memory

2021-03-12 Thread Christoph Hellwig
d_done in init/main.c: > complete() is done in a __ref function, while the corresponding > wait_for_completion() is in an __init function. I'm not sure if this matters in any way, but it does look fine to me: Reviewed-by: Christoph Hellwig

Re: [PATCH 1/2] devtmpfs: fix placement of complete() call

2021-03-12 Thread Christoph Hellwig
Looks fine: Reviewed-by: Christoph Hellwig

Re: [PATCH] mm/slab: kmalloc with GFP_DMA32 allocate from SLAB_CACHE_DMA32

2021-03-12 Thread Christoph Hellwig
On Fri, Mar 12, 2021 at 04:03:20PM +0800, Jianqun Xu wrote: > The flag GFP_DMA32 only effect in kmalloc_large currently. > > This patch will create caches with GFP_DMA32 to support kmalloc with > size under KMALLOC_MAX_CACHE_SIZE. No. No new code should use GFP_DMA32, never mind through slab.

kmap_local semantics

2021-03-11 Thread Christoph Hellwig
So with the new kmap_local interface is it possible / advisable to use local kmaps over code that might schedule(), e.g. to wait for I/O?

Re: [PATCH 06/17] kthread: cfi: disable callback pointer check with modules

2021-03-11 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 04:49:08PM -0800, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, a callback function passed to > __kthread_queue_delayed_work from a module points to a jump table > entry defined in the module instead of the one used in the core > kernel, which breaks function address

Re: add a new dma_alloc_noncontiguous API v3

2021-03-11 Thread Christoph Hellwig
Any comments? Especially on the uvcvideo conversion? On Mon, Mar 01, 2021 at 09:52:30AM +0100, Christoph Hellwig wrote: > Hi all, > > this series adds the new noncontiguous DMA allocation API requested by > various media driver maintainers. > > Changes since v2: > - reba

Re: [PATCH v2] block: Suppress uevent for hidden device when removed

2021-03-11 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent

2021-03-11 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 12:32:27PM +, Paul Cercueil wrote: > > dma_to_phys must not be used by drivers. > > > > I have a proper helper for this waiting for users: > > > > http://git.infradead.org/users/hch/misc.git/commitdiff/96a546e7229ec53aadbdb7936d1e5e6cb5958952 > > > > If you can

Re: [PATCH v2 5/5] drm/ingenic: Add option to alloc cached GEM buffers

2021-03-11 Thread Christoph Hellwig
On Sun, Mar 07, 2021 at 08:28:35PM +, Paul Cercueil wrote: > With the module parameter ingenic-drm.cached_gem_buffers, it is possible > to specify that we want GEM buffers backed by non-coherent memory. Shouldn't there be a way to discover this through a DT property?

Re: [RESEND PATCH v2.1 07/10] iomap: Introduce iomap_apply2() for operations on two files

2021-03-11 Thread Christoph Hellwig
On Thu, Mar 04, 2021 at 01:41:42PM +0800, Shiyang Ruan wrote: > Some operations, such as comparing a range of data in two files under > fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus, > we introduce iomap_apply2() to accept arguments from two files and > iomap_actor2_t for

Re: [PATCH v2 4/5] drm: Add and export function drm_gem_cma_sync_data

2021-03-11 Thread Christoph Hellwig
On Sun, Mar 07, 2021 at 08:28:34PM +, Paul Cercueil wrote: > + drm_atomic_for_each_plane_damage(, ) { > + for (i = 0; i < finfo->num_planes; i++) { > + daddr = drm_fb_cma_get_gem_addr(state->fb, state, i); > + > + /* Ignore x1/x2 values,

Re: [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent

2021-03-11 Thread Christoph Hellwig
> +int drm_gem_cma_mmap_noncoherent(struct drm_gem_object *obj, > + struct vm_area_struct *vma) > +{ > + struct drm_gem_cma_object *cma_obj; > + unsigned long pfn; > + int ret; > + > + /* > + * Clear the VM_PFNMAP flag that was set by

Re: [PATCH v2 1/5] drm: Add and export function drm_gem_cma_create_noncoherent

2021-03-11 Thread Christoph Hellwig
> +static struct drm_gem_cma_object * > +drm_gem_cma_create_with_cache_param(struct drm_device *drm, > + size_t size, > + bool noncoherent) Does this helper really make much sense? You basically have two function calls in it, out of

Re: [PATCH v2] configfs: Fix config_item refcnt error in __configfs_open_file()

2021-03-11 Thread Christoph Hellwig
On Thu, Mar 11, 2021 at 12:35:10PM +0100, gre...@linuxfoundation.org wrote: > From: Daniel Rosenberg > > __configfs_open_file() used to use configfs_get_config_item, but changed > in commit b0841eefd969 ("configfs: provide exclusion between IO and > removals") to just call to_item. The error

Re: [PATCH 9/9] vfio/pci: export igd support into vendor vfio_pci driver

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 08:31:27AM -0400, Jason Gunthorpe wrote: > Yes, that needs more refactoring. I'm viewing this series as a > "statement of intent" and once we commit to doing this we can go > through the bigger effort to split up vfio_pci_core and tidy its API. > > Obviously this is a big

Re: [PATCH] vfio/pci: Handle concurrent vma faults

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 03:06:07PM -0500, Peter Xu wrote: > On Wed, Mar 10, 2021 at 02:40:11PM -0400, Jason Gunthorpe wrote: > > On Wed, Mar 10, 2021 at 11:34:06AM -0700, Alex Williamson wrote: > > > > > > I think after the address_space changes this should try to stick with > > > > a normal

Re: [PATCH v1 02/14] vfio: Update vfio_add_group_dev() API

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 08:28:05AM -0700, Alex Williamson wrote: > > Yes, that series puts vfio_device everywhere so APIs like Alex needs > > to build here become trivial. > > > > The fact we both converged on this same requirement is good > > You're ahead of me in catching up with reviews

Re: [PATCH] configfs: Fix use-after-free issue in __configfs_open_file

2021-03-11 Thread Christoph Hellwig
Thanks, applied.

Re: [PATCH] configfs: Fix config_item refcnt error in __configfs_open_file()

2021-03-11 Thread Christoph Hellwig
I've actually just queued up a similar patch from Daiyue Zhang. > - goto out_put_item; > + goto out_put_module; > > if (type & CONFIGFS_ITEM_BIN_ATTR) { > buffer->bin_attr = to_bin_attr(dentry); > @@ -391,7 +391,7 @@ static int

Re: [RESEND][PATCH] nvme-pci: add the DISABLE_WRITE_ZEROES quirk for a Samsung PM1725a

2021-03-11 Thread Christoph Hellwig
Thanks, applied to nvme-5.12.

Re: [PATCH] nvme/rdma: Fix a use after free in nvmet_rdma_write_data_done

2021-03-11 Thread Christoph Hellwig
Thanks, applied to nvme-5.12.

Re: [PATCH 1/1] nvme-pci: add the DISABLE_WRITE_ZEROES quirk for a Samsung PM1725a

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 12:00:30PM -0800, Keith Busch wrote: > On Wed, Mar 10, 2021 at 02:41:10PM +0100, Christoph Hellwig wrote: > > On Wed, Mar 10, 2021 at 02:21:56PM +0100, Christoph Hellwig wrote: > > > Can you try this patch instead? > > > > > > http:/

Re: [PATCH 3/9] powerpc/pseries: remove the ppc-cmm file system

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 04:29:51PM +, Al Viro wrote: > On Tue, Mar 09, 2021 at 04:53:42PM +0100, Christoph Hellwig wrote: > > Just use the generic anon_inode file system. > > Umm... The only problem I see here is the lifetime rules for > that module, and that's not so

Re: [PATCH 4/9] drm: remove the drm file system

2021-03-11 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 04:32:34PM +, Al Viro wrote: > On Tue, Mar 09, 2021 at 04:53:43PM +0100, Christoph Hellwig wrote: > > Just use the generic anon_inode file system. > > Are you changing the lifetime rules for that module? The core drm module is pinned by the actual d

module refcount issues in the liquidio driver

2021-03-10 Thread Christoph Hellwig
Hi all, I just stumbled over the odd handling of module refcounts in the liquidio driver. The big red flag is the call to module_refcount in liquidio_watchdog, which will do the wrong thing for any external module refcount, like a userspace open. But more importantly the whole concept of

Re: [PATCH v1 2/7] PCI: Convert __pci_read_base() to __pci_bus_read_base()

2021-03-10 Thread Christoph Hellwig
> +static inline > int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, > + struct resource *res, unsigned int reg) This looks weird. Normal kernel style would be: static inline int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, struct

Re: [PATCH] fb_defio: Remove custom address_space_operations

2021-03-10 Thread Christoph Hellwig
e address_space in the first place. > > Signed-off-by: Matthew Wilcox (Oracle) Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH 1/1] nvme-pci: add the DISABLE_WRITE_ZEROES quirk for a Samsung PM1725a

2021-03-10 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 02:21:56PM +0100, Christoph Hellwig wrote: > Can you try this patch instead? > > http://lists.infradead.org/pipermail/linux-nvme/2021-February/023183.html Actually, please try the patch below instead, it looks like our existing logic messes up the units: d

Re: [PATCH 1/1] nvme-pci: add the DISABLE_WRITE_ZEROES quirk for a Samsung PM1725a

2021-03-10 Thread Christoph Hellwig
Can you try this patch instead? http://lists.infradead.org/pipermail/linux-nvme/2021-February/023183.html On Wed, Mar 10, 2021 at 02:51:16PM +0300, Dmitry Monakhov wrote: > This adds a quirk for Samsung PM1725a drive which fixes timeouts and > I/O errors due to the fact that the controller does

Re: [PATCH v6 4/4] dm: add DM_INTERPOSED_FLAG

2021-03-10 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 08:28:12AM +0300, Sergei Shtepa wrote: > > So instead of doing this shoudn't the interposer just always submit to the > > whole device? But if we keep it, the logic in this funtion should go > > into a block layer helper, passing a block device instead of the > >

Re: [PATCH v6 2/4] block: add blk_interposer

2021-03-10 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 07:53:13AM +0300, Sergei Shtepa wrote: > > Please avoid the overly long line. > > > > > + int ret = 0; > > > + > > > + if (WARN_ON(!interposer)) > > > > WARN_ON_ONCE? > > This function should be called quite rarely, and the absence of the interposer > parameter indicates

Re: [PATCH v2] include: Remove pagemap.h from blkdev.h

2021-03-10 Thread Christoph Hellwig
ases > the number of files from 240, but that's still a big win -- 68% > reduction instead of 77%. Looks good. I suspect blkdev.h also has penty of other includes that aren't needed either.. Reviewed-by: Christoph Hellwig

Re: make alloc_anon_inode more useful

2021-03-10 Thread Christoph Hellwig
On Wed, Mar 10, 2021 at 04:05:45AM +, Matthew Wilcox wrote: > On Tue, Mar 09, 2021 at 04:53:39PM +0100, Christoph Hellwig wrote: > > this series first renames the existing alloc_anon_inode to > > alloc_anon_inode_sb to clearly mark it as requiring a superblock. > > &

Re: make alloc_anon_inode more useful

2021-03-10 Thread Christoph Hellwig
On Tue, Mar 09, 2021 at 12:54:52PM -0400, Jason Gunthorpe wrote: > On Tue, Mar 09, 2021 at 04:53:39PM +0100, Christoph Hellwig wrote: > > Hi all, > > > > this series first renames the existing alloc_anon_inode to > > alloc_anon_inode_sb to clearly mark i

Re: [PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-10 Thread Christoph Hellwig
On Tue, Mar 09, 2021 at 10:39:05PM -0800, Minchan Kim wrote: > > -struct inode *alloc_anon_inode(struct super_block *s) > > +struct inode *alloc_anon_inode_sb(struct super_block *s) > > { > > static const struct address_space_operations anon_aops = { > > .set_page_dirty =

Re: [PATCH 9/9] vfio/pci: export igd support into vendor vfio_pci driver

2021-03-10 Thread Christoph Hellwig
The terminology is all weird here. You don't export functionality you move it. And this is not a "vendor" driver, but just a device specific one. > +struct igd_vfio_pci_device { > + struct vfio_pci_core_device vdev; > +}; Why do you need this separate structure? You could just use

Re: [PATCH 7/9] vfio/pci_core: split nvlink2 to nvlink2gpu and npu2

2021-03-10 Thread Christoph Hellwig
On Tue, Mar 09, 2021 at 08:33:55AM +, Max Gurtovoy wrote: > This is a preparation for moving vendor specific code from > vfio_pci_core to vendor specific vfio_pci drivers. The next step will be > creating a dedicated module to NVIDIA NVLINK2 devices with P9 extensions > and a dedicated module

Re: [PATCH v1 11/14] vfio/type1: Register device notifier

2021-03-10 Thread Christoph Hellwig
> + > + if (!dma->pfnmap) { > + struct vfio_device *device; > + unsigned long base_pfn; > + struct pfnmap_obj *pfnmap; Please factor this whole block into a separate helper to keep it readable.

Re: [PATCH v1 09/14] vfio/type1: Refactor pfn_list clearing

2021-03-10 Thread Christoph Hellwig
> +/* Return 1 if iommu->lock dropped and notified, 0 if done */ A bool would be more useful for that pattern. > +static int unmap_dma_pfn_list(struct vfio_iommu *iommu, struct vfio_dma *dma, > + struct vfio_dma **dma_last, int *retries) > +{ > + if

Re: [PATCH v1 07/14] vfio: Add a device notifier interface

2021-03-09 Thread Christoph Hellwig
On Mon, Mar 08, 2021 at 02:48:30PM -0700, Alex Williamson wrote: > Using a vfio device, a notifier block can be registered to receive > select device events. Notifiers can only be registered for contained > devices, ie. they are available through a user context. Registration > of a notifier

Re: [PATCH v1 02/14] vfio: Update vfio_add_group_dev() API

2021-03-09 Thread Christoph Hellwig
On Mon, Mar 08, 2021 at 02:47:40PM -0700, Alex Williamson wrote: > Rather than an errno, return a pointer to the opaque vfio_device > to allow the bus driver to call into vfio-core without additional > lookups and references. Note that bus drivers are still required > to use vfio_del_group_dev()

Re: [PATCH v2] libnvdimm: Notify disk drivers to revalidate region read-only

2021-03-09 Thread Christoph Hellwig
Looks good to me: Reviewed-by: Christoph Hellwig Question on the pre-existing code: given that nvdimm_check_and_set_ro is the only caller of set_disk_ro for nvdimm devices, we'll also get the message when initially setting up any read-only disk. Is that intentional?

Re: [PATCH v6 4/4] dm: add DM_INTERPOSED_FLAG

2021-03-09 Thread Christoph Hellwig
On Wed, Mar 03, 2021 at 03:30:18PM +0300, Sergei Shtepa wrote: > DM_INTERPOSED_FLAG allow to create dm targets on "the fly". > Underlying block device opens without a flag FMODE_EXCL. > Dm target receives bio from the original device via > blk_interposer. > > Signed-off-by: Sergei Shtepa > --- >

Re: [PATCH v6 2/4] block: add blk_interposer

2021-03-09 Thread Christoph Hellwig
> +static blk_qc_t __submit_bio_interposed(struct bio *bio) > +{ > + struct bio_list bio_list[2] = { }; > + blk_qc_t ret = BLK_QC_T_NONE; > + > + current->bio_list = bio_list; > + if (likely(bio_queue_enter(bio) == 0)) { > + struct block_device *bdev = bio->bi_bdev; > +

Re: [PATCH v6 1/4] block: add blk_mq_is_queue_frozen()

2021-03-09 Thread Christoph Hellwig
On Wed, Mar 03, 2021 at 03:30:15PM +0300, Sergei Shtepa wrote: > +bool blk_mq_is_queue_frozen(struct request_queue *q) > +{ > + bool ret; > + > + mutex_lock(>mq_freeze_lock); > + ret = percpu_ref_is_dying(>q_usage_counter) && > percpu_ref_is_zero(>q_usage_counter); Please avoid the

Re: [PATCH 2/5] mm/page_alloc: Add a bulk page allocator

2021-03-09 Thread Christoph Hellwig
Would vmalloc be another good user of this API? > + /* May set ALLOC_NOFRAGMENT, fragmentation will return 1 page. */ > + if (!prepare_alloc_pages(gfp_mask, 0, preferred_nid, nodemask, , > _mask, _flags)) This crazy long line is really hard to follow. > + return 0; > +

[PATCH 8/9] z3fold: remove the z3fold file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- mm/z3fold.c | 38 ++ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index e7cd9298b221f5..e0749a3d8987de 100644 --- a/mm/z3fold.c +++ b

[PATCH 9/9] zsmalloc: remove the zsmalloc file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- mm/zsmalloc.c | 48 +++- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a6449a2ad861de..a7d2f471935447 100644

[PATCH 7/9] iomem: remove the iomem file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- kernel/resource.c | 30 -- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 0fd091a3f2fc66..12560553c26796 100644 --- a/kernel

[PATCH 5/9] vmw_balloon: remove the balloon-vmware file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/misc/vmw_balloon.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 5d057a05ddbee8..be4be32f858253

[PATCH 6/9] virtio_balloon: remove the balloon-kvm file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/virtio/virtio_balloon.c | 30 +++--- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index

<    1   2   3   4   5   6   7   8   9   10   >