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

2024-04-14 Thread Matthew Wilcox
On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > Any other subsystem should use nice helper function aptly named > > string_is_vfs_ready() > > and apply additional restrictions if necessary. > > /proc/modules hints that newlines should be banned too, > and \x1f, and

Re: [PATCH 7/9] mm: Free up PG_slab

2024-04-01 Thread Matthew Wilcox
On Sun, Mar 31, 2024 at 11:11:10PM +0800, kernel test robot wrote: > kernel test robot noticed "UBSAN:shift-out-of-bounds_in_fs/proc/page.c" on: > > commit: 30e5296811312a13938b83956a55839ac1e3aa40 ("[PATCH 7/9] mm: Free up > PG_slab") Quite right. Spotted another one while I was at it. Not

Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker

2024-01-05 Thread Matthew Wilcox
On Fri, Jan 05, 2024 at 03:41:48PM -0500, Vivek Goyal wrote: > On Fri, Jan 05, 2024 at 08:21:00PM +0000, Matthew Wilcox wrote: > > On Fri, Jan 05, 2024 at 03:17:19PM -0500, Vivek Goyal wrote: > > > On Fri, Jan 05, 2024 at 06:53:05PM +0800, Hou Tao wrote: >

Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker

2024-01-05 Thread Matthew Wilcox
On Fri, Jan 05, 2024 at 03:17:19PM -0500, Vivek Goyal wrote: > On Fri, Jan 05, 2024 at 06:53:05PM +0800, Hou Tao wrote: > > From: Hou Tao > > > > When invoking virtio_fs_enqueue_req() through kworker, both the > > allocation of the sg array and the bounce buffer still use GFP_ATOMIC. > >

Re: [PATCH] virtiofs: use GFP_NOFS when enqueuing request through kworker

2024-01-03 Thread Matthew Wilcox
On Thu, Jan 04, 2024 at 09:58:05AM +0800, Hou Tao wrote: > static int virtio_fs_enqueue_req(struct virtio_fs_vq *fsvq, > - struct fuse_req *req, bool in_flight); > + struct fuse_req *req, bool in_flight, > +

Re: [2/2] virtiofs: Improve error handling in virtio_fs_get_tree()

2024-01-02 Thread Matthew Wilcox
On Tue, Jan 02, 2024 at 11:47:38AM +0100, Markus Elfring wrote: > > Do you consider more clarity in your argumentation? > > It is probably clear that the function call “kfree(NULL)” does not perform > data processing which is really useful for the caller. > Such a call is kept in some cases

Re: [2/2] virtiofs: Improve error handling in virtio_fs_get_tree()

2024-01-02 Thread Matthew Wilcox
On Tue, Jan 02, 2024 at 10:35:17AM +0100, Markus Elfring wrote: > >>> So what? kfree(NULL) is perfectly acceptable. > >> > >> I suggest to reconsider the usefulness of such a special function call. > > > > Can you be more explicit in your suggestion? > > I hope that the change acceptance can

Re: [PATCH 2/2] virtiofs: Improve error handling in virtio_fs_get_tree()

2023-12-29 Thread Matthew Wilcox
On Fri, Dec 29, 2023 at 10:10:08AM +0100, Markus Elfring wrote: > >> The kfree() function was called in two cases by > >> the virtio_fs_get_tree() function during error handling > >> even if the passed variable contained a null pointer. > > > > So what? kfree(NULL) is perfectly acceptable. > > I

Re: [PATCH 2/2] virtiofs: Improve error handling in virtio_fs_get_tree()

2023-12-29 Thread Matthew Wilcox
On Fri, Dec 29, 2023 at 09:38:47AM +0100, Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 29 Dec 2023 09:15:07 +0100 > > The kfree() function was called in two cases by > the virtio_fs_get_tree() function during error handling > even if the passed variable contained a null pointer. So

Re: [PATCH v6 2/4] dax/bus: Use guard(device) in sysfs attribute helpers

2023-12-14 Thread Matthew Wilcox
On Thu, Dec 14, 2023 at 10:25:27PM -0700, Vishal Verma wrote: > @@ -294,13 +294,10 @@ static ssize_t available_size_show(struct device *dev, > struct device_attribute *attr, char *buf) > { > struct dax_region *dax_region = dev_get_drvdata(dev); > - unsigned long long size;

Re: [PATCH v2 0/5] MODVERSIONS + RUST Redux

2023-11-27 Thread Matthew Maurer
> > > > > > > With regards to future directions that likely won't work for loosening > > > > it: > > > > Unfortunately, the .rmeta format itself is not stable, so I wouldn't > > > > want to > > > > teach genksyms to open it up and split out the pieces for specific > > > > functions. > > > >

Re: [PATCH v2 0/5] MODVERSIONS + RUST Redux

2023-11-22 Thread Matthew Maurer
> So, even if you enable CONFIG_MODVERSIONS, > nothing is checked for Rust. > Genksyms computes a CRC from "int foo", and > the module subsystem confirms it is a "int" > variable. > > We know this check always succeeds. > > Why is this useful? The reason this is immediately useful is that it

[PATCH v2 3/5] modpost: Extended modversion support

2023-11-17 Thread Matthew Maurer
leading dots, we reproduce the munging for the new format. Other architectures do not appear to have architecture-specific usage of this information. Signed-off-by: Matthew Maurer --- arch/powerpc/kernel/module_64.c | 25 - kernel/module/internal.h| 11 kernel/module/main.c

[PATCH v2 5/5] export_report: Use new version info format

2023-11-17 Thread Matthew Maurer
The new version info format has a superset of symbols in the old format. Since this is a tool for in-tree modules, we don't need to parse the old one with this tool any longer. Signed-off-by: Matthew Maurer --- scripts/export_report.pl | 22 ++ 1 file changed, 10 insertions

[PATCH v2 4/5] rust: Allow MODVERSIONS

2023-11-17 Thread Matthew Maurer
With variable length symbol names from extended modversions, we can enable MODVERSIONS alongside RUST due to support for its longer symbol names. Signed-off-by: Matthew Maurer --- init/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig index 9ffb103fc927

[PATCH v2 2/5] modules: Refactor + kdoc elf_validity_cached_copy

2023-11-17 Thread Matthew Maurer
pt to ensure offsets are inbounds of strtab While some of these oversights would normally be worrying, all of the potentially unverified accesses occur after signature check, and only in response to a user who can load a kernel module. Signed-off-by: Matthew Maurer --- kernel/module/internal.h |

[PATCH v2 1/5] export_report: Rehabilitate script

2023-11-17 Thread Matthew Maurer
* modules.order has .o files when in a build dir, support this * .mod.c source layout has changed, update regexes to match * Add a stage 3, to be more robust against additional .mod.c content Signed-off-by: Matthew Maurer --- scripts/export_report.pl | 9 +++-- 1 file changed, 7 insertions

[PATCH v2 0/5] MODVERSIONS + RUST Redux

2023-11-17 Thread Matthew Maurer
clarity and checks were valuable. [1] https://lore.kernel.org/lkml/2023061155.1349375-1-g...@garyguo.net/ [2] https://lore.kernel.org/lkml/CAK7LNATsuszFR7JB5ZkqVS1W=hWr9=e7btf+mvgj+nxt3az...@mail.gmail.com/ [3] https://lore.kernel.org/lkml/zvznh%2fpa5hivr...@bombadil.infradead.org/ Matthew Maurer

[PATCH 2/3] modpost: Extended modversion support

2023-11-15 Thread Matthew Maurer
it possible to enable MODVERSIONS and RUST at the same time. Signed-off-by: Matthew Maurer --- arch/powerpc/kernel/module_64.c | 24 +- init/Kconfig| 1 - kernel/module/internal.h| 16 ++- kernel/module/main.c| 9 +++- kernel/module/version.c

[PATCH 3/3] rust: Require RUST_MODULES for module support

2023-11-07 Thread Matthew Maurer
that won't be used without Rust modules. Signed-off-by: Matthew Maurer --- init/Kconfig | 21 + kernel/module/Kconfig | 1 + rust/exports.c| 4 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index 9ffb103fc927

Re: [v5 0/1] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-06-27 Thread Matthew Wilcox
On Tue, Jun 27, 2023 at 06:22:47PM +0200, Markus Elfring wrote: > >> How do you think about to put additional information below triple dashes > >> (or even into improved change descriptions)? > >> > >> See also: > >>

Re: [v5 0/1] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-06-27 Thread Matthew Wilcox
On Tue, Jun 27, 2023 at 08:08:19AM +0200, Markus Elfring wrote: > > The thought was to put descriptions unsuitable for commit header in the > > cover letter. > > How do you think about to put additional information below triple dashes > (or even into improved change descriptions)? > > See also:

Re: [PATCH v2] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-27 Thread Matthew Wilcox
On Thu, Apr 27, 2023 at 06:35:57PM -0700, Dan Williams wrote: > Jane Chu wrote: > > Hi, Dan, > > > > On 4/27/2023 2:36 PM, Dan Williams wrote: > > > Jane Chu wrote: > > >> When dax fault handler fails to provision the fault page due to > > >> hwpoison, it returns VM_FAULT_SIGBUS which lead to a

Re: [PATCH v2] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-27 Thread Matthew Wilcox
On Thu, Apr 27, 2023 at 04:36:58PM -0700, Jane Chu wrote: > > This change results in EHWPOISON leaking to usersapce in the case of > > read(2), that's not a return code that block I/O applications have ever > > had to contend with before. Just as badblocks cause EIO to be returned, > > so should

Re: [PATCH] dax: enable dax fault handler to report VM_FAULT_HWPOISON

2023-04-06 Thread Matthew Wilcox
On Thu, Apr 06, 2023 at 11:55:56AM -0600, Jane Chu wrote: > static vm_fault_t dax_fault_return(int error) > { > if (error == 0) > return VM_FAULT_NOPAGE; > - return vmf_error(error); > + else if (error == -ENOMEM) > + return VM_FAULT_OOM; > + else if

Re: [PATCH v9 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-02-05 Thread Matthew Wilcox
On Sat, Feb 04, 2023 at 02:58:38PM +, Shiyang Ruan wrote: > + if (mf_flags & MF_MEM_PRE_REMOVE) { > + xfs_info(mp, "device is about to be removed!"); > + down_write(>m_super->s_umount); > + error = sync_filesystem(mp->m_super); > + /*

Re: [PATCH v9 1/3] xfs: fix the calculation of length and end

2023-02-05 Thread Matthew Wilcox
On Sat, Feb 04, 2023 at 02:58:36PM +, Shiyang Ruan wrote: > @@ -222,8 +222,8 @@ xfs_dax_notify_failure( > len -= ddev_start - offset; > offset = 0; > } > - if (offset + len > ddev_end) > - len -= ddev_end - offset; > + if (offset + len - 1

Re: [PATCH v9 2/3] fs: move drop_pagecache_sb() for others to use

2023-02-05 Thread Matthew Wilcox
On Sat, Feb 04, 2023 at 02:58:37PM +, Shiyang Ruan wrote: > @@ -678,6 +679,48 @@ void drop_super_exclusive(struct super_block *sb) > } > EXPORT_SYMBOL(drop_super_exclusive); > > +/* You've gone to the trouble of writing kernel-doc, just add the extra '*' and make it actually part of the

[PATCH v5 24/32] tools/testing/nvdimm: Convert to printbuf

2022-08-07 Thread Matthew Wilcox (Oracle)
From: Kent Overstreet This converts from seq_buf to printbuf. Here we're using printbuf with an external buffer, meaning it's a direct conversion. Signed-off-by: Kent Overstreet Cc: Dan Williams Cc: Dave Hansen Cc: nvd...@lists.linux.dev --- tools/testing/nvdimm/test/ndtest.c | 22

Re: [PATCH v2] mm: fix missing wake-up event for FSDAX pages

2022-07-05 Thread Matthew Wilcox
On Tue, Jul 05, 2022 at 02:18:19PM -0700, Andrew Morton wrote: > On Tue, 5 Jul 2022 20:35:32 +0800 Muchun Song > wrote: > > > FSDAX page refcounts are 1-based, rather than 0-based: if refcount is > > 1, then the page is freed. The FSDAX pages can be pinned through GUP, > > then they will be

Re: [PATCH] mm: fix missing wake-up event for FSDAX pages

2022-07-04 Thread Matthew Wilcox
On Mon, Jul 04, 2022 at 03:40:54PM +0800, Muchun Song wrote: > FSDAX page refcounts are 1-based, rather than 0-based: if refcount is > 1, then the page is freed. The FSDAX pages can be pinned through GUP, > then they will be unpinned via unpin_user_page() using a folio variant > to put the page,

Re: [PATCH] sparse: use force attribute for vm_fault_t casts

2022-05-14 Thread Matthew Wilcox
On Sat, May 14, 2022 at 05:26:21PM +0300, Vasily Averin wrote: > Fixes sparse warnings: > ./include/trace/events/fs_dax.h:10:1: sparse: > got restricted vm_fault_t > ./include/trace/events/fs_dax.h:153:1: sparse: > got restricted vm_fault_t > fs/dax.c:563:39: sparse:got restricted

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

2022-02-02 Thread Matthew Wilcox
On Wed, Feb 02, 2022 at 10:33:04PM +0800, Muchun Song wrote: > page_vma_mapped_walk() is supposed to check if a page is mapped into a vma. > However, not all page frames (e.g. PFN_DEV) have a associated struct page > with it. There is going to be some duplicate codes similar with this function >

Re: [PATCH v10 2/9] mm: factor helpers for memory_failure_dev_pagemap

2022-02-01 Thread Matthew Wilcox
On Thu, Jan 27, 2022 at 08:40:51PM +0800, Shiyang Ruan wrote: > +static int mf_generic_kill_procs(unsigned long long pfn, int flags, > + struct dev_pagemap *pgmap) > +{ > + struct page *page = pfn_to_page(pfn); > + LIST_HEAD(to_kill); > + dax_entry_t cookie; > + > + /*

Re: [PATCH] fpga: dfl: pci: gracefully handle misconfigured port entries

2021-04-20 Thread matthew . gerlach
On Tue, 20 Apr 2021, Tom Rix wrote: On 4/20/21 10:27 AM, matthew.gerl...@linux.intel.com wrote: From: Matthew Gerlach Gracefully ignore misconfigured port entries encountered in incorrect FPGA images. Signed-off-by: Matthew Gerlach --- drivers/fpga/dfl-pci.c | 16 +++- 1

[PATCH] fpga: dfl: pci: gracefully handle misconfigured port entries

2021-04-20 Thread matthew . gerlach
From: Matthew Gerlach Gracefully ignore misconfigured port entries encountered in incorrect FPGA images. Signed-off-by: Matthew Gerlach --- drivers/fpga/dfl-pci.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl

[PATCH] arm64: Show three registers per line

2021-04-20 Thread Matthew Wilcox (Oracle)
Displaying two registers per line takes 15 lines. That improves to just 10 lines if we display three registers per line, which reduces the amount of information lost when oopses are cut off. It stays within 80 columns and matches x86-64. Signed-off-by: Matthew Wilcox (Oracle) --- arch/arm64

Re: [PATCH v2] docs: proc.rst: meminfo: briefly describe gaps in memory accounting

2021-04-20 Thread Matthew Wilcox
On Tue, Apr 20, 2021 at 03:13:54PM +0300, Mike Rapoport wrote: > Add a paragraph that explains that it may happen that the counters in > /proc/meminfo do not add up to the overall memory usage. ... that is, the sum may be lower because memory is allocated for other purposes that is not reported

Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-20 Thread Matthew Wilcox
On Tue, Apr 20, 2021 at 09:39:54AM +0200, Geert Uytterhoeven wrote: > > +++ b/include/linux/mm_types.h > > @@ -97,10 +97,10 @@ struct page { > > }; > > struct {/* page_pool used by netstack */ > > /** > > -*

Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-19 Thread Matthew Wilcox
On Tue, Apr 20, 2021 at 02:48:17AM +, Vineet Gupta wrote: > > 32-bit architectures which expect 8-byte alignment for 8-byte integers > > and need 64-bit DMA addresses (arc, arm, mips, ppc) had their struct > > page inadvertently expanded in 2019. > > FWIW, ARC doesn't require 8 byte alignment

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 09:58:51PM +0200, David Sterba wrote: > On Fri, Apr 16, 2021 at 07:34:51PM +0200, Miguel Ojeda wrote: > > something like: > > > > [0.903456] rust_begin_unwind+0x9/0x10 > > [0.903456] ? _RNvNtCsbDqzXfLQacH_4core9panicking9panic_fmt+0x29/0x30 > > [0.903456] ?

Re: [PATCH v7 09/28] mm: Create FolioFlags

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 03:25:46PM +0200, Peter Zijlstra wrote: > On Fri, Apr 09, 2021 at 07:50:46PM +0100, Matthew Wilcox (Oracle) wrote: > > These new functions are the folio analogues of the PageFlags functions. > > If CONFIG_DEBUG_VM_PGFLAGS is enabled, we check the foli

Re: [PATCH net-next v3 2/5] mm: add a signature in struct page

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 01:22:04PM +0200, Jesper Dangaard Brouer wrote: > On Wed, 14 Apr 2021 13:09:47 -0700 > Shakeel Butt wrote: > > > On Wed, Apr 14, 2021 at 12:42 PM Jesper Dangaard Brouer > > wrote: > > > > > [...] > > > > > > > > > > Can this page_pool be used for TCP RX zerocopy? If

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 02:56:17PM +0300, Mike Rapoport wrote: > On Mon, Apr 19, 2021 at 12:23:02PM +0100, Matthew Wilcox wrote: > > So you're calling page_is_secretmem() on a struct page without having > > a refcount on it. That is definitely not allowed. secretmem seems

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 12:36:19PM +0300, Mike Rapoport wrote: > Well, most if the -4.2% of the performance regression kbuild reported were > due to repeated compount_head(page) in page_mapping(). So the whole point > of this patch is to avoid calling page_mapping(). It's quite ludicrous how many

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 11:42:18AM +0300, Mike Rapoport wrote: > The perf profile of the test indicated that the regression is caused by > page_is_secretmem() called from gup_pte_range() (inlined by gup_pgd_range): Uhh ... you're calling it in the wrong place!

Re: [PATCH v2 01/12] docs: path-lookup: update follow_managed() part

2021-04-18 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 10:33:00AM +0800, Fox Chen wrote: > On Mon, Apr 19, 2021 at 10:17 AM Matthew Wilcox wrote: > > > > On Tue, Mar 16, 2021 at 01:47:16PM +0800, Fox Chen wrote: > > > -In the absence of symbolic links, ``walk_component()`` creates a new

Re: [PATCH v2 01/12] docs: path-lookup: update follow_managed() part

2021-04-18 Thread Matthew Wilcox
On Tue, Mar 16, 2021 at 01:47:16PM +0800, Fox Chen wrote: > -In the absence of symbolic links, ``walk_component()`` creates a new > +As the last step of ``walk_component()``, ``step_into()`` will be called > either You can drop ``..`` from around function named which are followed with ().

Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-17 Thread Matthew Wilcox
On Sat, Apr 17, 2021 at 09:18:57PM +, David Laight wrote: > Ugly as well. Thank you for expressing your opinion. Again.

Re: [PATCH 2/2] mm: Indicate pfmemalloc pages in compound_head

2021-04-17 Thread Matthew Wilcox
On Sat, Apr 17, 2021 at 09:13:45PM +, David Laight wrote: > > struct {/* page_pool used by netstack */ > > - /** > > -* @dma_addr: might require a 64-bit value on > > -* 32-bit architectures. > > -

Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-17 Thread Matthew Wilcox
On Sat, Apr 17, 2021 at 09:32:06PM +0300, Ilias Apalodimas wrote: > > +static inline void page_pool_set_dma_addr(struct page *page, dma_addr_t > > addr) > > +{ > > + page->dma_addr[0] = addr; > > + if (sizeof(dma_addr_t) > sizeof(unsigned long)) > > + page->dma_addr[1] = addr >> 16

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-17 Thread Matthew Wilcox
On Sat, Apr 17, 2021 at 12:31:37PM +0200, Arnd Bergmann wrote: > On Fri, Apr 16, 2021 at 5:27 PM Matthew Wilcox wrote: > > diff --git a/include/net/page_pool.h b/include/net/page_pool.h > > index b5b195305346..db7c7020746a 100644 > > --- a/include/net/page_pool.h > > ++

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 07:08:23PM +0200, Jesper Dangaard Brouer wrote: > On Fri, 16 Apr 2021 16:27:55 +0100 > Matthew Wilcox wrote: > > > On Thu, Apr 15, 2021 at 08:08:32PM +0200, Jesper Dangaard Brouer wrote: > > > See below patch. Where I swap32 the dma addre

Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-16 Thread Matthew Wilcox
Replacement patch to fix compiler warning. From: "Matthew Wilcox (Oracle)" Date: Fri, 16 Apr 2021 16:34:55 -0400 Subject: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems To: bro...@redhat.com Cc: linux-kernel@vger.kernel.org, linux...@kvack.org, net...@vger.

[PATCH 6/6] mm: Constify page_count and page_ref_count

2021-04-16 Thread Matthew Wilcox (Oracle)
Now that compound_head() accepts a const struct page pointer, these two functions can be marked as not modifying the page pointer they are passed. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page_ref.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include

[PATCH 5/6] mm: Constify get_pfnblock_flags_mask and get_pfnblock_migratetype

2021-04-16 Thread Matthew Wilcox (Oracle)
The struct page is not modified by these routines, so it can be marked const. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pageblock-flags.h | 2 +- mm/page_alloc.c | 13 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/linux

[PATCH 4/6] mm: Make compound_head const-preserving

2021-04-16 Thread Matthew Wilcox (Oracle)
ned-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 04a34c08e0a6..d8e26243db25 100644 --- a/include/linux/page-flags.h +++ b/include/linux/p

[PATCH 3/6] mm/page_owner: Constify dump_page_owner

2021-04-16 Thread Matthew Wilcox (Oracle)
dump_page_owner() only uses struct page to find the page_ext, and lookup_page_ext() already takes a const argument. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page_owner.h | 6 +++--- mm/page_owner.c| 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 2/6] mm/debug: Factor PagePoisoned out of __dump_page

2021-04-16 Thread Matthew Wilcox (Oracle)
Move the PagePoisoned test into dump_page(). Skip the hex print for poisoned pages -- we know they're full of . Move the reason printing from __dump_page() to dump_page(). Signed-off-by: Matthew Wilcox (Oracle) --- mm/debug.c | 25 +++-- 1 file changed, 7

[PATCH 1/6] mm: Make __dump_page static

2021-04-16 Thread Matthew Wilcox (Oracle)
The only caller of __dump_page() now opencodes dump_page(), so remove it as an externally visible symbol. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mmdebug.h | 3 +-- mm/debug.c | 2 +- mm/page_alloc.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions

[RESEND][PATCH 0/6] Constify struct page arguments

2021-04-16 Thread Matthew Wilcox (Oracle)
offer these patches as a few steps towards being able to make dump_page() take a const page pointer. Matthew Wilcox (Oracle) (6): mm: Make __dump_page static mm/debug: Factor PagePoisoned out of __dump_page mm/page_owner: Constify dump_page_owner mm: Make compound_head const-preserving mm

[PATCH 2/2] mm: Indicate pfmemalloc pages in compound_head

2021-04-16 Thread Matthew Wilcox (Oracle)
loc(). Since page_pool doesn't want to set its magic value on pages which are pfmemalloc, we can use bit 1 of compound_head to indicate that the page came from the memory reserves. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 12 +++- include/linux/mm_types.h |

[PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-16 Thread Matthew Wilcox (Oracle)
get_user_pages_fast() could dereference a bogus compound_head(). Fixes: c25fff7171be ("mm: add dma_addr_t to struct page") Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm_types.h | 4 ++-- include/net/page_pool.h | 12 +++- net/core/page_pool.c | 12 +++

[PATCH 0/2] Change struct page layout for page_pool

2021-04-16 Thread Matthew Wilcox (Oracle)
functionality. It is much less urgent. I'd really like to see Mel & Michal's thoughts on it. I have only compile-tested these patches. Matthew Wilcox (Oracle) (2): mm: Fix struct page layout on 32-bit systems mm: Indicate pfmemalloc pages in compound_head include/linux/mm.h

Re: [PATCH 00/13] [RFC] Rust support

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 07:18:48PM +0200, Peter Zijlstra wrote: > On Fri, Apr 16, 2021 at 07:10:17PM +0200, Miguel Ojeda wrote: > > > Of course, UB is only a subset of errors, but it is a major one, and > > particularly critical for privileged code. > > I've seen relatively few UBSAN warnings

[PATCH v3 2/2] spi: altera: Add DFL bus driver for Altera API Controller

2021-04-16 Thread matthew . gerlach
From: Matthew Gerlach This patch adds a Device Feature List (DFL) bus driver for the Altera SPI Master controller. The SPI master is connected to an Intel SPI Slave to Avalon Bridge inside an Intel MAX10 BMC Chip. Signed-off-by: Matthew Gerlach --- v3: Instantiate SPI device instead

[PATCH v3 0/2] spi: altera: Add DFL bus support for Altera SPI

2021-04-16 Thread matthew . gerlach
From: Matthew Gerlach This patch set adds Device Feature List (DFL) bus support for the Altera SPI Master controller. Patch 1 separates spi-altera.c into spi-altera-core.c and spi-altera-platform.c. Patch 2 adds spi-altera-dfl.c. Matthew Gerlach (2): spi: altera: separate core code from

[PATCH v3 1/2] spi: altera: separate core code from platform code

2021-04-16 Thread matthew . gerlach
From: Matthew Gerlach In preparation of adding support for a new bus type, separate the core spi-altera code from the platform driver code. Signed-off-by: Matthew Gerlach --- drivers/spi/Kconfig | 9 +- drivers/spi/Makefile | 3 +- drivers/spi/spi-altera-core.c

Re: [RFCv2 00/13] TDX and guest memory unmapping

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 06:40:53PM +0300, Kirill A. Shutemov wrote: > TDX integrity check failures may lead to system shutdown host kernel must > not allow any writes to TD-private memory. This requirment clashes with > KVM design: KVM expects the guest memory to be mapped into host userspace >

Re: [PATCH v7 02/28] mm: Introduce struct folio

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 09, 2021 at 07:50:39PM +0100, Matthew Wilcox (Oracle) wrote: > A struct folio is a new abstraction to replace the venerable struct page. > A function which takes a struct folio argument declares that it will > operate on the entire (possibly compound) page, not just PAGE_S

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-16 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 08:08:32PM +0200, Jesper Dangaard Brouer wrote: > See below patch. Where I swap32 the dma address to satisfy > page->compound having bit zero cleared. (It is the simplest fix I could > come up with). I think this is slightly simpler, and as a bonus code that assumes the

Re: [PATCH 00/13] [RFC] Rust support

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 02:07:49PM +0100, Wedson Almeida Filho wrote: > There is nothing in C forcing developers to actually use DEFINE_MUTEX_GUARD. > So > someone may simply forget (or not know that they need) to lock > current->perf_event_mutex and directly access some field protected by it.

Re: [PATCH] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 11:37:19AM +0200, Peter Enderborg wrote: > diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c > index 6fa761c9cc78..3c1a82b51a6f 100644 > --- a/fs/proc/meminfo.c > +++ b/fs/proc/meminfo.c > @@ -16,6 +16,7 @@ > #ifdef CONFIG_CMA > #include > #endif > +#include >

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 07:32:35AM +, David Laight wrote: > From: Matthew Wilcox > > Sent: 15 April 2021 23:22 > > > > On Thu, Apr 15, 2021 at 09:11:56PM +, David Laight wrote: > > > Isn't it possible to move the field down one long? > > &

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-15 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 09:11:56PM +, David Laight wrote: > Isn't it possible to move the field down one long? > This might require an explicit zero - but this is not a common > code path - the extra write will be noise. Then it overlaps page->mapping. See emails passim.

Re: [Outreachy kernel] [PATCH v2] staging: media: atomisp: pci: Change line break to avoid an open parenthesis at the end of the line

2021-04-15 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 08:57:04PM +0100, Matthew Wilcox wrote: > On Thu, Apr 15, 2021 at 10:49:55PM +0300, Sakari Ailus wrote: > > On Thu, Apr 15, 2021 at 06:14:09PM +0100, Matthew Wilcox wrote: > > > On Thu, Apr 15, 2021 at 02:08:19PM -0300, Aline Santana Cordeiro wrote: >

Re: [Outreachy kernel] [PATCH v2] staging: media: atomisp: pci: Change line break to avoid an open parenthesis at the end of the line

2021-04-15 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 10:49:55PM +0300, Sakari Ailus wrote: > On Thu, Apr 15, 2021 at 06:14:09PM +0100, Matthew Wilcox wrote: > > On Thu, Apr 15, 2021 at 02:08:19PM -0300, Aline Santana Cordeiro wrote: > > > -const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mb

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-15 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 08:08:32PM +0200, Jesper Dangaard Brouer wrote: > +static inline > +dma_addr_t page_pool_dma_addr_read(dma_addr_t dma_addr) > +{ > + /* Workaround for storing 64-bit DMA-addr on 32-bit machines in struct > + * page. The page->dma_addr share area with

Re: [Outreachy kernel] [PATCH v2] staging: media: atomisp: pci: Change line break to avoid an open parenthesis at the end of the line

2021-04-15 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 02:08:19PM -0300, Aline Santana Cordeiro wrote: > -const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus( > -u32 mbus_code); > +const struct atomisp_format_bridge* > +get_atomisp_format_bridge_from_mbus(u32 mbus_code); No, this does not match coding

Re: [PATCH v3 0/5] mm/memcg: Reduce kmemcache memory accounting overhead

2021-04-15 Thread Matthew Wilcox
On Tue, Apr 13, 2021 at 09:20:22PM -0400, Waiman Long wrote: > With memory accounting disable, the run time was 2.848s. With memory > accounting enabled, the run times with the application of various > patches in the patchset were: > > Applied patches Run time Accounting overhead Overhead

Re: [PATCH 5.10 12/25] radix tree test suite: Fix compilation

2021-04-15 Thread Matthew Wilcox
On Thu, Apr 15, 2021 at 04:48:06PM +0200, Greg Kroah-Hartman wrote: > From: Matthew Wilcox (Oracle) > > [ Upstream commit 7487de534dcbe143e6f41da751dd3ffcf93b00ee ] > > Commit 4bba4c4bb09a added tools/include/linux/compiler_types.h which > includes linux/compiler-gcc.h. Unf

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-14 Thread Matthew Wilcox
On Wed, Apr 14, 2021 at 09:13:22PM +0200, Jesper Dangaard Brouer wrote: > (If others want to reproduce). First I could not reproduce on ARM32. > Then I found out that enabling CONFIG_XEN on ARCH=arm was needed to > cause the issue by enabling CONFIG_ARCH_DMA_ADDR_T_64BIT. hmmm ... you should be

Re: [PATCH 00/13] [RFC] Rust support

2021-04-14 Thread Matthew Wilcox
On Wed, Apr 14, 2021 at 08:45:51PM +0200, oj...@kernel.org wrote: > - Manish Goregaokar implemented the fallible `Box`, `Arc`, and `Rc` > allocator APIs in Rust's `alloc` standard library for us. There's a philosophical point to be discussed here which you're skating right over! Should

Re: [PATCH 09/13] Samples: Rust examples

2021-04-14 Thread Matthew Wilcox
On Wed, Apr 14, 2021 at 09:42:26PM +0200, Miguel Ojeda wrote: > On Wed, Apr 14, 2021 at 9:34 PM Linus Torvalds > wrote: > > > > Honestly, I'd like to see a real example. This is fine for testing, > > but I'd like to see something a bit more real, and a bit less special > > than the Android

Re: [PATCH 01/13] kallsyms: Support "big" kernel symbols (2-byte lengths)

2021-04-14 Thread Matthew Wilcox
On Wed, Apr 14, 2021 at 08:45:52PM +0200, oj...@kernel.org wrote: > Increasing to 255 is not enough in some cases, and therefore > we need to introduce 2-byte lengths to the symbol table. We call > these "big" symbols. > > In order to avoid increasing all lengths to 2 bytes (since most > of them

Re: [PATCH v2 1/2] spi: Add DFL bus driver for Altera SPI Master

2021-04-14 Thread matthew . gerlach
-dw-core.c and bus specific code like spi-dw-pci.c and spi-dw-mmioc.c? Thanks for the review. Matthew

Re: [PATCH] mm: Optimise nth_page for contiguous memmap

2021-04-14 Thread Matthew Wilcox
On Wed, Apr 14, 2021 at 05:24:42PM +0200, David Hildenbrand wrote: > On 13.04.21 21:46, Matthew Wilcox (Oracle) wrote: > > +#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) > > #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) > >

Re: [PATCH v2 10/16] mm: multigenerational lru: mm_struct list

2021-04-14 Thread Matthew Wilcox
On Tue, Apr 13, 2021 at 12:56:27AM -0600, Yu Zhao wrote: > In order to scan page tables, we add an infrastructure to maintain > either a system-wide mm_struct list or per-memcg mm_struct lists. > Multiple threads can concurrently work on the same mm_struct list, and > each of them will be given a

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-14 Thread Matthew Wilcox
On Wed, Apr 14, 2021 at 10:10:44AM +0200, Jesper Dangaard Brouer wrote: > Yes, indeed! - And very frustrating. It's keeping me up at night. > I'm dreaming about 32 vs 64 bit data structures. My fitbit stats tell > me that I don't sleep well with these kind of dreams ;-) Then you're going to love

[PATCH v2 1/2] spi: Add DFL bus driver for Altera SPI Master

2021-04-13 Thread matthew . gerlach
From: Matthew Gerlach This patch adds a Device Feature List (DFL) bus driver for the Altera SPI Master controller. The SPI master is connected to an Intel SPI Slave to Avalon Master Bridge inside an Intel MAX10 BMC Chip. Signed-off-by: Matthew Gerlach --- v2: moved drivers/fpga/dfl-spi

[PATCH v2 2/2] hwmon: intel-m10-bmc-hwmon: add sensor support of Intel D5005 card

2021-04-13 Thread matthew . gerlach
From: Matthew Gerlach Like the Intel N3000 card, the Intel D5005 has a MAX10 based BMC. This commit adds support for the D5005 sensors that are monitored by the MAX10 BMC. Signed-off-by: Matthew Gerlach Signed-off-by: Russ Weight Acked-by: Lee Jones --- v2: change variable name from

[PATCH v2 0/2] spi: add BMC support for Intel D5005 card

2021-04-13 Thread matthew . gerlach
From: Matthew Gerlach This patch set adds support for the Board Management Controller (BMC) of an Intel D5005 card. The BMC support requires a Device Feature List (DFL) bus driver for the Altera SPI Master controller and hwmon support for the sensors monitored by the BMC. Patch 1 adds a dfl

Re: [Outreachy kernel] [PATCH] :staging: rtl8723bs: Remove useless led_blink_hdl()

2021-04-13 Thread Matthew Wilcox
On Tue, Apr 13, 2021 at 09:45:03PM +0200, Fabio M. De Francesco wrote: > 1) The driver doesn't call that function from anywhere else than the macro. > 2) You have explained that the macro add its symbol to a slot in an array > that would shift all the subsequent elements down if that macro is not

[PATCH] mm: Optimise nth_page for contiguous memmap

2021-04-13 Thread Matthew Wilcox (Oracle)
add(%rax,%rcx,8),%rbx Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- include/linux/mm.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 25b9041f9925..2327f99b121f 100644 --- a/include/linux/mm.h +++ b/include/l

Re: [PATCH v7] mm: Add set/end/wait functions for PG_private_2

2021-04-13 Thread Matthew Wilcox
On Tue, Apr 13, 2021 at 04:11:41PM +0100, David Howells wrote: > Suggested-by: Linus Torvalds > Signed-off-by: David Howells > Tested-by: Jeff Layton > Tested-by: Dave Wysochanski Reviewed-by: Matthew Wilcox (Oracle)

Re: [PATCH v3 01/18] vfs: add fileattr ops

2021-04-13 Thread Matthew Wilcox
On Thu, Mar 25, 2021 at 08:37:38PM +0100, Miklos Szeredi wrote: > @@ -107,6 +110,8 @@ fiemap: no > update_time: no > atomic_open: shared (exclusive if O_CREAT is set in open flags) > tmpfile: no > +fileattr_get:no or exclusive > +fileattr_set:exclusive >

RE: [PATCH 2/3] fpga: dfl: Add DFL bus driver for Altera SPI Master

2021-04-12 Thread matthew . gerlach
ack from the SPI maintainers and continue investigating collapsing the DFL driver and the platform sub-driver into a single DFL driver. My first attempt did not go well. Matthew directory of the app > Thanks Hao Thanks Yilun

Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: hal: Remove camelcase

2021-04-12 Thread Matthew Wilcox
On Mon, Apr 12, 2021 at 11:02:58PM +0200, Fabio M. De Francesco wrote: > Removed camelcase in (some) symbols. Further work is needed. What would be more useful for this driver is making it use drivers/net/wireless/realtek/rtlwifi/btcoexist/ which has already graduated out of staging. I haven't

Re: [PATCH 1/1] mm: Fix struct page layout on 32-bit systems

2021-04-12 Thread Matthew Wilcox
t; have to be kept intact. In above, I'm unsure @index is untouched. Well, I tried three different approaches. Here's the one I hated the least. From: "Matthew Wilcox (Oracle)" Date: Sat, 10 Apr 2021 16:12:06 -0400 Subject: [PATCH] mm: Fix struct page layout on 32-bit systems 32-bit

Re: [PATCH 02/17] locking: Add split_lock

2021-04-12 Thread Matthew Wilcox
On Mon, Apr 12, 2021 at 04:29:28PM +0200, Thomas Gleixner wrote: > On Fri, Apr 09 2021 at 03:51, Matthew Wilcox wrote: > > Bitlocks do not currently participate in lockdep. Conceptually, a > > bit_spinlock is a split lock, eg across each bucket in a hash table. > > The struc

  1   2   3   4   5   6   7   8   9   10   >