Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-07-11 Thread David Hildenbrand
On 11.07.23 16:30, Aneesh Kumar K.V wrote: David Hildenbrand writes: On 16.06.23 00:00, Vishal Verma wrote: With DAX memory regions originating from CXL memory expanders or NVDIMMs, the kmem driver may be hot-adding huge amounts of system memory on a system without enough 'regular&

Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-07-13 Thread David Hildenbrand
On 13.07.23 08:45, Verma, Vishal L wrote: On Tue, 2023-07-11 at 17:21 +0200, David Hildenbrand wrote: On 11.07.23 16:30, Aneesh Kumar K.V wrote: David Hildenbrand writes: Maybe the better alternative is teach add_memory_resource()/try_remove_memory() to do that internally. In the

Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-07-13 Thread David Hildenbrand
On 13.07.23 17:15, Verma, Vishal L wrote: On Thu, 2023-07-13 at 09:23 +0200, David Hildenbrand wrote: On 13.07.23 08:45, Verma, Vishal L wrote: I'm taking a shot at implementing the splitting internally in memory_hotplug.c. The caller (kmem) side does become trivial with this approach

Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-07-13 Thread David Hildenbrand
On 13.07.23 17:40, Verma, Vishal L wrote: On Thu, 2023-07-13 at 17:23 +0200, David Hildenbrand wrote: On 13.07.23 17:15, Verma, Vishal L wrote: On Thu, 2023-07-13 at 09:23 +0200, David Hildenbrand wrote: On 13.07.23 08:45, Verma, Vishal L wrote: I'm taking a shot at implementin

Re: [PATCH 0/3] mm: use memmap_on_memory semantics for dax/kmem

2023-07-14 Thread David Hildenbrand
On 13.07.23 21:12, Jeff Moyer wrote: David Hildenbrand writes: On 16.06.23 00:00, Vishal Verma wrote: The dax/kmem driver can potentially hot-add large amounts of memory originating from CXL memory expanders, or NVDIMMs, or other 'device memories'. There is a chance there is

Re: [PATCH v2 0/3] mm: use memmap_on_memory semantics for dax/kmem

2023-07-25 Thread David Hildenbrand
On 20.07.23 09:14, Vishal Verma wrote: The dax/kmem driver can potentially hot-add large amounts of memory originating from CXL memory expanders, or NVDIMMs, or other 'device memories'. There is a chance there isn't enough regular system memory available to fit the memmap for this new memory. It'

Re: [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks

2023-08-14 Thread David Hildenbrand
On 14.08.23 08:45, Huang, Ying wrote: "Verma, Vishal L" writes: On Mon, 2023-07-24 at 13:54 +0800, Huang, Ying wrote: Vishal Verma writes: @@ -2035,12 +2056,38 @@ void try_offline_node(int nid) } EXPORT_SYMBOL(try_offline_node); -static int __ref try_remove_memory(u64 start, u64 size

Re: [PATCH RFC 00/37] Add support for arm64 MTE dynamic tag storage reuse

2023-09-11 Thread David Hildenbrand
On 11.09.23 13:52, Catalin Marinas wrote: On Wed, Sep 06, 2023 at 12:23:21PM +0100, Alexandru Elisei wrote: On Thu, Aug 24, 2023 at 04:24:30PM +0100, Catalin Marinas wrote: On Thu, Aug 24, 2023 at 01:25:41PM +0200, David Hildenbrand wrote: On 24.08.23 13:06, David Hildenbrand wrote

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-14 Thread David Hildenbrand
> Am 14.02.2021 um 10:20 schrieb Mike Rapoport : > > On Fri, Feb 12, 2021 at 10:18:19AM +0100, David Hildenbrand wrote: >>> On 12.02.21 00:09, Mike Rapoport wrote: >>> On Thu, Feb 11, 2021 at 01:07:10PM +0100, David Hildenbrand wrote: >>>> On 11.02.21 1

Re: [PATCH v5 1/1] mm: refactor initialization of struct page for holes in memory layout

2021-02-15 Thread David Hildenbrand
On 14.02.21 18:29, Mike Rapoport wrote: On Fri, Feb 12, 2021 at 10:56:19AM +0100, David Hildenbrand wrote: On 12.02.21 10:55, David Hildenbrand wrote: On 08.02.21 12:08, Mike Rapoport wrote: +#ifdef CONFIG_SPARSEMEM + /* +* Sections in the memory map may not match actual

Re: [PATCH v5 1/1] mm: refactor initialization of struct page for holes in memory layout

2021-02-15 Thread David Hildenbrand
On 15.02.21 10:00, Michal Hocko wrote: On Sun 14-02-21 20:00:16, Mike Rapoport wrote: On Fri, Feb 12, 2021 at 02:18:20PM +0100, Michal Hocko wrote: On Fri 12-02-21 11:42:15, David Hildenbrand wrote: On 12.02.21 11:33, Michal Hocko wrote: [...] I have to digest this but my first impression

[PATCH v1 1/2] virtio-mem: don't read big block size in SBM

2021-02-15 Thread David Hildenbrand
Fixes: 4ba50cd3355d ("virtio-mem: Big Block Mode (BBM) memory hotplug") Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Marek Kedzierski Cc: Hui Zhu Cc: Pankaj Gupta Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 15 --- 1 file changed, 8

[PATCH v1 0/2] virito-mem: one fix and VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-02-15 Thread David Hildenbrand
only support adding/ removing individual Linux memory blocks (e.g., 128MB on x86-64). While we might still be able to allow for reading unplugged memory with file-based memory backends in the future (and I have plans/prototypes for it), at least in the near future we cannot support it. David

[PATCH v1 2/2] virtio-mem: support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-02-15 Thread David Hildenbrand
c: Hui Zhu Cc: Sebastien Boeuf Cc: Pankaj Gupta Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 12 include/uapi/linux/virtio_mem.h | 10 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_mem.c

Re: [External] Re: [PATCH v15 4/8] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page

2021-02-16 Thread David Hildenbrand
On 15.02.21 20:02, Michal Hocko wrote: On Tue 16-02-21 01:48:29, Muchun Song wrote: On Tue, Feb 16, 2021 at 12:28 AM Michal Hocko wrote: On Mon 15-02-21 23:36:49, Muchun Song wrote: [...] There shouldn't be any real reason why the memory allocation for vmemmaps, or handling vmemmap in genera

Re: [External] Re: [PATCH v15 4/8] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page

2021-02-16 Thread David Hildenbrand
If current node has no memory and other nodes have enough memory. We can fail to allocate vmemmap pages. But actually it is suitable to allocate vmemmap pages from other nodes. Right? Falling back to a different node would be very suboptimal because then you would have vmemmap back by remote pag

Re: [PATCH 0/3] mm/page_alloc: Fix pageblock_order with HUGETLB_PAGE_SIZE_VARIABLE

2021-02-16 Thread David Hildenbrand
But again, if there are valid use cases then sure, let's make the code fully compatible with HUGETLB_PAGE_ORDER > MAX_ORDER. Given that gigantic HugeTLB allocation can fallback on alloc_contig_pages() or CMA if/when available, is there a real need for HUGETLB_PAGE_ORDER to be upto MAX_ORDER,

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-16 Thread David Hildenbrand
On 16.02.21 17:25, James Bottomley wrote: On Mon, 2021-02-15 at 20:20 +0100, Michal Hocko wrote: [...] What kind of flags are we talking about and why would that be a problem with memfd_create interface? Could you be more specific please? You mean what were the ioctl flags in the patch seri

Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-02-16 Thread David Hildenbrand
For the other parts, the question is what we actually want to let user space configure. Being able to specify "Very secure" "maximum secure" "average secure" all doesn't really make sense to me. Well, it doesn't to me either unless the user feels a cost/benefit, so if max cost $100 per invoc

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-07 Thread David Hildenbrand
On 07.04.21 17:14, Catalin Marinas wrote: On Wed, Apr 07, 2021 at 11:20:18AM +0100, Steven Price wrote: On 31/03/2021 19:43, Catalin Marinas wrote: When a slot is added by the VMM, if it asked for MTE in guest (I guess that's an opt-in by the VMM, haven't checked the other patches), can we reje

[PATCH v1 0/2] drivers: don't select DMA_CMA or CMA

2021-04-08 Thread David Hildenbrand
Cc: linux-asp...@lists.ozlabs.org Cc: dri-de...@lists.freedesktop.org Cc: linux-arm-ker...@lists.infradead.org Cc: etna...@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org David Hildenbrand (2): drivers/video/fbdev: don't select DMA_CMA drivers/gpu/drm: don't select DMA_CMA or C

[PATCH v1 1/2] drivers/video/fbdev: don't select DMA_CMA

2021-04-08 Thread David Hildenbrand
ork without CMA just fine -- esp. when we wouldn't have HAVE_DMA_CONTIGUOUS or CMA right now. Signed-off-by: David Hildenbrand --- drivers/video/fbdev/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index

[PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
ork without CMA just fine -- esp. when we wouldn't have HAVE_DMA_CONTIGUOUS right now. Signed-off-by: David Hildenbrand --- drivers/gpu/drm/aspeed/Kconfig | 3 +-- drivers/gpu/drm/etnaviv/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/aspeed

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
On 08.04.21 11:56, Mike Rapoport wrote: On Thu, Apr 08, 2021 at 11:20:11AM +0200, David Hildenbrand wrote: Random drivers should not override a user configuration of core knobs (e.g., CONFIG_DMA_CMA=n). Use "imply" instead, to still respect dependencies and manual overrides. "

[PATCH v2 0/2] drivers: don't select DMA_CMA or CMA

2021-04-08 Thread David Hildenbrand
Cc: Randy Dunlap Cc: Peter Collingbourne Cc: linux-asp...@lists.ozlabs.org Cc: dri-de...@lists.freedesktop.org Cc: linux-arm-ker...@lists.infradead.org Cc: etna...@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org David Hildenbrand (2): drivers/video/fbdev: don't select DMA_CMA dri

[PATCH v2 1/2] drivers/video/fbdev: don't select DMA_CMA

2021-04-08 Thread David Hildenbrand
ork without CMA just fine -- esp. when we wouldn't have HAVE_DMA_CONTIGUOUS or CMA right now. Signed-off-by: David Hildenbrand --- drivers/video/fbdev/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index

[PATCH v2 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
ork without CMA just fine -- esp. when we wouldn't have HAVE_DMA_CONTIGUOUS right now. Signed-off-by: David Hildenbrand --- drivers/gpu/drm/aspeed/Kconfig | 3 +-- drivers/gpu/drm/etnaviv/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/aspeed

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
On 08.04.21 12:20, Arnd Bergmann wrote: On Thu, Apr 8, 2021 at 11:22 AM David Hildenbrand wrote: Random drivers should not override a user configuration of core knobs (e.g., CONFIG_DMA_CMA=n). Use "imply" instead, to still respect dependencies and manual overrides. "Thi

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
On 08.04.21 12:27, David Hildenbrand wrote: On 08.04.21 12:20, Arnd Bergmann wrote: On Thu, Apr 8, 2021 at 11:22 AM David Hildenbrand wrote: Random drivers should not override a user configuration of core knobs (e.g., CONFIG_DMA_CMA=n). Use "imply" instead, to still respect depend

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
In particular, it does not prevent a configuration with 'DRM_CMA=m' I assume you meant "DRM_CMA=n" ? DRM_CMA cannot be built as a module. Ok, at least that makes it easier. and 'DRMA_ASPEED_GFX=y', or any build failures from such a configuration. I don't follow. "DRM_CMA=n" and 'DRMA_ASPEE

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
On 08.04.21 13:44, Arnd Bergmann wrote: On Thu, Apr 8, 2021 at 1:00 PM David Hildenbrand wrote: It is a somewhat awkward way to say "prevent this symbol from being =y if the dependency is =m". What would be the right thing to do in the case here then to achieve the "if DRM

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-08 Thread David Hildenbrand
On 08.04.21 14:49, Linus Walleij wrote: On Thu, Apr 8, 2021 at 2:01 PM David Hildenbrand wrote: This is something you could do using a hidden helper symbol like config DRMA_ASPEED_GFX bool "Aspeed display driver" select DRM_WANT_CMA config DRM_WANT_CMA

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-08 Thread David Hildenbrand
On 08.04.21 16:18, Catalin Marinas wrote: On Wed, Apr 07, 2021 at 04:52:54PM +0100, Steven Price wrote: On 07/04/2021 16:14, Catalin Marinas wrote: On Wed, Apr 07, 2021 at 11:20:18AM +0100, Steven Price wrote: On 31/03/2021 19:43, Catalin Marinas wrote: When a slot is added by the VMM, if it

Re: [PATCH v7 7/8] x86/Kconfig: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

2021-04-08 Thread David Hildenbrand
On 08.04.21 15:36, Christoph Hellwig wrote: On Thu, Apr 08, 2021 at 02:18:03PM +0200, Oscar Salvador wrote: Enable x86_64 platform to use the MHP_MEMMAP_ON_MEMORY feature. +config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE + def_bool y This needs to go into a common file, with the architectures ju

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-09 Thread David Hildenbrand
On 08.04.21 15:19, Arnd Bergmann wrote: On Thu, Apr 8, 2021 at 2:50 PM Linus Walleij wrote: On Thu, Apr 8, 2021 at 2:01 PM David Hildenbrand wrote: This is something you could do using a hidden helper symbol like config DRMA_ASPEED_GFX bool "Aspeed display driver"

Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv

2021-04-09 Thread David Hildenbrand
On 08.04.21 22:29, Arnd Bergmann wrote: On Thu, Apr 8, 2021 at 6:45 PM David Hildenbrand wrote: On 08.04.21 14:49, Linus Walleij wrote: On Thu, Apr 8, 2021 at 2:01 PM David Hildenbrand wrote: This is something you could do using a hidden helper symbol like config DRMA_ASPEED_GFX

Re: [PATCH v6 4/8] mm,memory_hotplug: Allocate memmap from the added memory range

2021-04-09 Thread David Hildenbrand
On 09.04.21 07:10, Oscar Salvador wrote: On Thu, Apr 08, 2021 at 10:05:18PM -0700, Andrew Morton wrote: Yes please. I just sent v7 with that yesterday [1] Hope David/Michal finds some time to review patch#4 as that is the only missing piece atm. I will have a look next week. Still have to w

Re: [PATCH v7] RISC-V: enable XIP

2021-04-09 Thread David Hildenbrand
On 09.04.21 09:14, Alex Ghiti wrote: Le 4/9/21 à 2:51 AM, Alexandre Ghiti a écrit : From: Vitaly Wool Introduce XIP (eXecute In Place) support for RISC-V platforms. It allows code to be executed directly from non-volatile storage directly addressable by the CPU, such as QSPI NOR flash which ca

Re: [PATCH] mm/page_alloc: Ensure that HUGETLB_PAGE_ORDER is less than MAX_ORDER

2021-04-09 Thread David Hildenbrand
On 09.04.21 07:55, Anshuman Khandual wrote: pageblock_order must always be less than MAX_ORDER, otherwise it might lead to an warning during boot. A similar problem got fixed on arm64 platform with the commit 79cc2ed5a716 ("arm64/mm: Drop THP conditionality from FORCE_MAX_ZONEORDER"). Assert the

[PATCH v1] CPU hotplug: active_reader not woken up in some cases - deadlock

2014-12-08 Thread David Hildenbrand
incremented, but a sleeping active_writer might never be woken up, therefore never exiting the loop in cpu_hotplug_begin(). This quick fix wakes up the active_writer proactively. The writer already goes back to sleep if the ref count isn't already down to 0, so this should be fine.

Re: [PATCH v1] CPU hotplug: active_reader not woken up in some cases - deadlock

2014-12-08 Thread David Hildenbrand
The title should of course say active_writer ... grml David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.o

Re: [PATCH v1] CPU hotplug: active_reader not woken up in some cases - deadlock

2014-12-08 Thread David Hildenbrand
> On Mon, Dec 08, 2014 at 07:13:03PM +0100, David Hildenbrand wrote: > > Commit b2c4623dcd07 ("rcu: More on deadlock between CPU hotplug and > > expedited > > grace periods") introduced another problem that can easily be reproduced by > > starting/stopping cpu

Re: [PATCH v1] CPU hotplug: active_reader not woken up in some cases - deadlock

2014-12-08 Thread David Hildenbrand
> > active_writer is cleared while holding cpuhp_lock, so this should be safe, > > right? > > You lost me on that one. Don't we get to that piece of code precisely > because we don't hold any of the CPU-hotplug locks? If so, the > writer might well hold all the locks it needs, and might well cha

[PATCH v2] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-08 Thread David Hildenbrand
e setting of TASK_UNINTERRUPTIBLE in cpu_hotplug_begin() above the check, so we won't lose any wakeups when racing with put_online_cpus(). Can't reproduce it with this fix. Signed-off-by: David Hildenbrand --- kernel/cpu.c | 12 ++-- 1 file changed, 10 insertions(+), 2 delet

Re: [PATCH v2] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
> The compiler is within its rights to optimize the active_writer local > variable out of existence, thus re-introducing the possible race with > the writer that can pass a NULL pointer to wake_up_process(). So you > really need the ACCESS_ONCE() on the read from cpu_hotplug.active_writer. > Pleas

Re: [PATCH v2] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
> > Therefore we have to move the condition check inside the > > __set_current_state(TASK_UNINTERRUPTIBLE) -> schedule(); > > section to not miss any wake ups when the condition is satisfied. > > > > So wake_up_process() will either see TASK_RUNNING and do nothing or see > > TASK_UNINTERRUPTIBL

Re: [PATCH v2] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
> On Tue, Dec 09, 2014 at 11:11:01AM +0100, David Hildenbrand wrote: > > > > Therefore we have to move the condition check inside the > > > > __set_current_state(TASK_UNINTERRUPTIBLE) -> schedule(); > > > > section to not miss any wake ups when the c

Re: [PATCH v2] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
> On Tue, Dec 09, 2014 at 11:11:01AM +0100, David Hildenbrand wrote: > > > > Therefore we have to move the condition check inside the > > > > __set_current_state(TASK_UNINTERRUPTIBLE) -> schedule(); > > > > section to not miss any wake ups when the c

[PATCH v3] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
- Move setting of TASK_UNINTERRUPTIBLE in cpu_hotplug_begin() above the condition check. (otherwise a wakeup might get lost) Can't reproduce it with this fix. Signed-off-by: David Hildenbrand --- kernel/cpu.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff

Re: [PATCH v3] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
> On Tue, Dec 09, 2014 at 01:23:31PM +0100, David Hildenbrand wrote: > > Commit b2c4623dcd07 ("rcu: More on deadlock between CPU hotplug and > > expedited > > grace periods") introduced another problem that can easily be reproduced by > > starting/stopping cpu

Re: [PATCH v3] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-09 Thread David Hildenbrand
> (sorry if this was already discussed, I ignored most of my emails > I got this week) > > On 12/09, David Hildenbrand wrote: > > > > @@ -116,7 +118,13 @@ void put_online_cpus(void) > > if (cpu_hotplug.active_writer == current) > >

[PATCH v4] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-10 Thread David Hildenbrand
ree. There is no need to take the lock in put_online_cpus() anymore. Also rearrange the lockdep anotations so we won't get false positives. Can't reproduce it with this fix. Signed-off-by: David Hildenbrand --- kernel/cpu.c | 60 ++-- 1 f

Re: [PATCH v4] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-10 Thread David Hildenbrand
and turns refcount into an atomic variable. We > also introduce a wait queue for the active_writer, to avoid possible races and > use-after-free. There is no need to take the lock in put_online_cpus() > anymore. > > Also rearrange t

[PATCH v2 0/5] Reenable might_sleep() checks for might_fault()

2014-12-10 Thread David Hildenbrand
_fault(), avoiding to produce false positives. Cross compiled on powerpc, arm, sparc, sparc64, arm64, x86_64, i386, mips, alpha, ia64, xtensa, m68k, microblaze. Tested on s390. David Hildenbrand (5): uaccess: add pagefault_count to thread_info uaccess: count pagefault_disable() levels in pagef

[PATCH v2 5/5] uaccess: CONFIG_DEBUG_PAGEFAULT_COUNT to debug pagefault_count

2014-12-10 Thread David Hildenbrand
This patch introduces CONFIG_DEBUG_PAGEFAULT_COUNT, to detect over-/underflows in the pagefault_count resulting from a wrong usage of pagefault_enable() and pagefault_disable(). Signed-off-by: David Hildenbrand --- include/linux/uaccess.h | 8 +++- lib/Kconfig.debug | 9

[PATCH v2 4/5] uaccess: clarify that uaccess may only sleep if pagefaults are not disabled

2014-12-10 Thread David Hildenbrand
In general, non-atomic variants of user access functions may not sleep if pagefaults are disabled. Let's update all relevant comments in uaccess code. This also refelects the might_sleep() checks in might_fault(). Signed-off-by: David Hildenbrand --- arch/avr32/include/asm/uaccess.h

[PATCH v2 2/5] uaccess: count pagefault_disable() levels in pagefault_count

2014-12-10 Thread David Hildenbrand
() envionment by calling pagefault_disabled(). Signed-off-by: David Hildenbrand --- include/linux/uaccess.h | 45 ++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index ecd3319..1dfc678 100644

[PATCH v2 3/5] mm, uaccess: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-12-10 Thread David Hildenbrand
ges in case of a might_sleep() warning. We can't move the code directly into kernel.h for now, as that results in ugly header recursions we can't avoid for now. Signed-off-by: David Hildenbrand --- include/linux/kernel.h | 3 ++- mm/memory.c| 18 ++ 2 files

[PATCH v2 1/5] uaccess: add pagefault_count to thread_info

2014-12-10 Thread David Hildenbrand
. The new counter is added directly below the preempt_count, except for archs relying on a manual calculation of asm offsets - to minimize the changes. Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/thread_info.h | 1 + arch/arc/include/asm/thread_info.h| 1 + arch/arm

Re: [PATCH v4] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-10 Thread David Hildenbrand
> On 12/10, David Hildenbrand wrote: > > > > @@ -127,20 +119,16 @@ void put_online_cpus(void) > > { > > if (cpu_hotplug.active_writer == current) > > return; > > - if (!mutex_trylock(&cpu_hotplug.lock)) { > >

Re: [PATCH v4] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-10 Thread David Hildenbrand
only thing that is bugging me is this part. Without the lock we can't > > guarantee that another get_online_cpus() just arrived and bumped the > > refcount > > to 0. > > > > Of course this only applies to misuse of put/get_online_cpus. > > > > We could hack some loop that tries to cmp_xchng with

Re: [PATCH v4] CPU hotplug: active_writer not woken up in some cases - deadlock

2014-12-11 Thread David Hildenbrand
> This is subjective, but how about > > static bool xxx(void) > { > mutex_lock(&cpu_hotplug.lock); > if (atomic_read(&cpu_hotplug.refcount) == 0) > return true; > mutex_unlock(&cpu_hotplug.lock); > return fal

Re: [PATCH RFC v2 3/4] virtio: allow finalize_features to fail

2014-12-05 Thread David Hildenbrand
> This will make it easy for transports to validate features and return > failure. > > Signed-off-by: Michael S. Tsirkin > --- > include/linux/virtio_config.h | 3 ++- > drivers/lguest/lguest_device.c | 4 +++- > drivers/misc/mic/card/mic_virtio.c | 4 +++- > drivers/remotep

[PATCH v1 3/5] mm, uaccess: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-12-05 Thread David Hildenbrand
ges in case of a might_sleep() warning. We can't move the code directly into kernel.h for now, as that results in ugly header recursions we can't avoid for now. Signed-off-by: David Hildenbrand --- include/linux/kernel.h | 3 ++- mm/memory.c| 19 +++ 2 files

[PATCH v1 4/5] uaccess: clearify that uaccess may only sleep if pagefaults are not disabled

2014-12-05 Thread David Hildenbrand
In general, non-atomic variants of user access functions may not sleep if pagefaults are disabled. Let's update all relevant comments in uaccess code. This also refelects the might_sleep() checks in might_fault(). Signed-off-by: David Hildenbrand --- arch/avr32/include/asm/uaccess.h

[PATCH v1 0/5] Reenable might_sleep() checks for might_fault()

2014-12-05 Thread David Hildenbrand
of the struct for these archs ...). Thanks! David David Hildenbrand (5): uaccess: add pagefault_count to thread_info uaccess: count pagefault_disable() levels in pagefault_count mm, uaccess: trigger might_sleep() in might_fault() when pagefaults are disabled uaccess: clearify that uaccess may

[PATCH v1 2/5] uaccess: count pagefault_disable() levels in pagefault_count

2014-12-05 Thread David Hildenbrand
() envionment by calling pagefault_disabled(). Signed-off-by: David Hildenbrand --- include/linux/uaccess.h | 45 ++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index ecd3319..1dfc678 100644

[PATCH v1 1/5] uaccess: add pagefault_count to thread_info

2014-12-05 Thread David Hildenbrand
. Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/thread_info.h | 1 + arch/arc/include/asm/thread_info.h| 1 + arch/arm/include/asm/thread_info.h| 1 + arch/arm64/include/asm/thread_info.h | 1 + arch/avr32/include/asm/thread_info.h | 1 + arch/blackfin

[PATCH v1 5/5] uaccess: CONFIG_DEBUG_PAGEFAULT_COUNT to debug pagefault_count

2014-12-05 Thread David Hildenbrand
This patch introduces CONFIG_DEBUG_PAGEFAULT_COUNT, to detect over-/underflows in the pagefault_count resulting from a wrong usage of pagefault_enable() and pagefault_disable(). Signed-off-by: David Hildenbrand --- include/linux/uaccess.h | 8 +++- lib/Kconfig.debug | 9

Re: [PATCH v1 3/5] mm, uaccess: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-12-05 Thread David Hildenbrand
> On Fri, Dec 05, 2014 at 12:18:07PM +0100, David Hildenbrand wrote: > > -void might_fault(void) > > +void __might_fault(const char *file, int line) > > { > > /* > > * Some code (nfs/sunrpc) uses socket ops on kernel memory while > > @@ -37

Re: [PATCH v1 3/5] mm, uaccess: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-12-05 Thread David Hildenbrand
> From: David Hildenbrand [... > > > This should be likely() instead of unlikely(), no? > > > I'd rather write this > > > > > > if (pagefault_disabled()) > > > return; > > > __might_sleep(file, line, 0); > > > &

Re: [PATCH v1 1/5] uaccess: add pagefault_count to thread_info

2014-12-08 Thread David Hildenbrand
> Am 05.12.2014 um 12:18 schrieb David Hildenbrand: > > This patch adds the pagefault_count to the thread_info of all > > architectures. It will be used to count the pagefault_disable() levels > > on a per-thread basis. > > > > We are not reusing the preempt_count

Re: [PATCH v2 0/5] Reenable might_sleep() checks for might_fault()

2015-01-12 Thread David Hildenbrand
it the handling of > pagefault_disable() and the preempt count. This will be done in another > series. > Purpose of this series is to reenable might_sleep() checks for might_fault(), > avoiding to produce false positives. > > Cross compiled on powerpc, arm, sparc, sparc64, arm64,

Re: [PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-04-02 Thread David Hildenbrand
> This adds support for SW breakpoints inserted by userspace. > > We do this by trapping all BKPT exceptions in the > hypervisor (MDCR_EL2_TDE). The kvm_debug_exit_arch carries the address > of the exception. If user-space doesn't know of the breakpoint then we > have a guest inserted breakpoint a

Re: [PATCH v2 01/10] KVM: add commentary for kvm_debug_exit_arch struct

2015-04-01 Thread David Hildenbrand
> Bring into line with the commentary for the other structures and their > KVM_EXIT_* cases. s/commentary/comments/ in the subject and description. Unless you want to add a lengthy discussion :) > > Signed-off-by: Alex Bennée > > --- > > v2 > - add comments for other exit types > > diff --

Re: [PATCH v2 03/10] KVM: arm: guest debug, define API headers

2015-04-01 Thread David Hildenbrand
> This commit defines the API headers for guest debugging. There are two > architecture specific debug structures: > > - kvm_guest_debug_arch, allows us to pass in HW debug registers > - kvm_debug_exit_arch, signals the exact debug exit and pc > > The type of debugging being used is control b

Re: [PATCH v2 04/10] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-04-01 Thread David Hildenbrand
> This commit adds a stub function to support the KVM_SET_GUEST_DEBUG > ioctl. Currently any operation flag will return EINVAL. Actual Well it won't return -EINVAL if you push in KVM_GUESTDBG_ENABLE or 0. "Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, a

Re: [PATCH v2 03/10] KVM: arm: guest debug, define API headers

2015-04-01 Thread David Hildenbrand
> > Looks good to me! > > Is that a Reviewed-by? Now it is :) Reviewed-by: David Hildenbrand David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vge

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-01 Thread David Hildenbrand
> This is a precursor for later patches which will need to do more to > setup debug state before entering the hyp.S switch code. The existing > functionality for setting mdcr_el2 has been moved out of hyp.S and now > uses the value kept in vcpu->arch.mdcr_el2. > > This also moves the conditional s

Re: [PATCH v2 04/10] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-04-13 Thread David Hildenbrand
> On Tue, Mar 31, 2015 at 04:08:02PM +0100, Alex Bennée wrote: > > This commit adds a stub function to support the KVM_SET_GUEST_DEBUG > > ioctl. Currently any operation flag will return EINVAL. Actual > > functionality will be added with further patches. > > > > Signed-off-by: Alex Bennée . > >

[PATCH v1 0/2] kasan: fix memory notifier handling

2018-05-22 Thread David Hildenbrand
If onlining of pages fails, we don't properly free up memory. Also, the memory hotplug notifier is not registered early enough, still failing on certain setups where memory is detected, added and onlined early. David Hildenbrand (2): kasan: free allocated shadow memory on MEM_CANCEL_OF

[PATCH v1 1/2] kasan: free allocated shadow memory on MEM_CANCEL_OFFLINE

2018-05-22 Thread David Hildenbrand
We have to free memory again when we cancel onlining, otherwise a later onlining attempt will fail. Signed-off-by: David Hildenbrand --- mm/kasan/kasan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 135ce2838c89..8baefe1a674b 100644 --- a/mm

[PATCH v1 2/2] kasan: fix memory hotplug during boot

2018-05-22 Thread David Hildenbrand
Using module_init() is wrong. E.g. ACPI adds and onlines memory before our memory notifier gets registered. This makes sure that ACPI memory detected during boot up will not result in a kernel crash. Easily reproducable with QEMU, just specify a DIMM when starting up. Signed-off-by: David

Re: [PATCH v1 1/2] kasan: free allocated shadow memory on MEM_CANCEL_OFFLINE

2018-05-22 Thread David Hildenbrand
On 22.05.2018 11:55, David Hildenbrand wrote: > We have to free memory again when we cancel onlining, otherwise a later > onlining attempt will fail. > > Signed-off-by: David Hildenbrand > --- > mm/kasan/kasan.c | 1 + > 1 file changed, 1 insertion(+) > > diff --

[PATCH v2 0/2] kasan: fix memory notifier handling

2018-05-22 Thread David Hildenbrand
If onlining of pages fails (is canceled), we don't properly free up memory. Also, the memory hotplug notifier is not registered early enough, still failing on certain setups where memory is detected, added and onlined early. v1 -> v2: - s/MEM_CANCEL_OFFLINE/MEM_CANCEL_ONLINE David Hilden

[PATCH v2 2/2] kasan: fix memory hotplug during boot

2018-05-22 Thread David Hildenbrand
Using module_init() is wrong. E.g. ACPI adds and onlines memory before our memory notifier gets registered. This makes sure that ACPI memory detected during boot up will not result in a kernel crash. Easily reproducable with QEMU, just specify a DIMM when starting up. Signed-off-by: David

[PATCH v2 1/2] kasan: free allocated shadow memory on MEM_CANCEL_ONLINE

2018-05-22 Thread David Hildenbrand
We have to free memory again when we cancel onlining, otherwise a later onlining attempt will fail. Signed-off-by: David Hildenbrand --- mm/kasan/kasan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 135ce2838c89..53564229674b 100644 --- a/mm

Re: [PATCH v2 2/2] kasan: fix memory hotplug during boot

2018-05-22 Thread David Hildenbrand
On 22.05.2018 18:26, Andrey Ryabinin wrote: > > > On 05/22/2018 01:07 PM, David Hildenbrand wrote: >> Using module_init() is wrong. E.g. ACPI adds and onlines memory before >> our memory notifier gets registered. >> >> This makes sure that ACPI memory detected

Re: [PATCH v2 2/2] kasan: fix memory hotplug during boot

2018-05-23 Thread David Hildenbrand
On 23.05.2018 11:59, Andrey Ryabinin wrote: > > > On 05/23/2018 12:07 AM, Andrew Morton wrote: >> On Tue, 22 May 2018 22:50:12 +0300 Andrey Ryabinin >> wrote: >> >>> >>> >>> On 05/22/2018 07:36 PM, David Hildenbrand wrote: >>>>

[PATCH v1 03/10] kasan: prepare for online/offline of different start/size

2018-05-23 Thread David Hildenbrand
split between boot and hotplug memory. Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: kasan-...@googlegroups.com Signed-off-by: David Hildenbrand --- mm/kasan/kasan.c | 107 ++- 1 file changed, 69 insertions(+), 38 deletions(-) diff

[PATCH v1 00/10] mm: online/offline 4MB chunks controlled by device driver

2018-05-23 Thread David Hildenbrand
: - "mm: introduce and use PageOffline()" -- fix set_page_address() handling for WANT_PAGE_VIRTUAL - Include "mm/page_ext.c: support online/offline of memory < section size" - Include "kasan: prepare for online/offline of different start/size" - Include &quo

[PATCH v1 09/10] mm/memory_hotplug: teach offline_pages() to not try forever

2018-05-23 Thread David Hildenbrand
hmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Greg Kroah-Hartman Cc: Rashmica Gupta Cc: Balbir Singh Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Dan Williams Cc: Joonsoo Kim Cc: Pavel Tatashin Cc: Reza Arbab Cc: Thomas Gleixner Signed-off-by: David Hildenbrand ---

[PATCH v1 08/10] mm/memory_hotplug: allow to control onlining/offlining of memory by a driver

2018-05-23 Thread David Hildenbrand
Cc: Joonsoo Kim Cc: Reza Arbab Cc: Thomas Gleixner Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 22 ++ drivers/xen/balloon.c | 2 +- include/linux/memory.h | 1 + include/linux/memory_hotplug.h | 4 +++- mm/memory_hotplug.c

[PATCH v1 10/10] mm/memory_hotplug: allow online/offline memory by a kernel module

2018-05-23 Thread David Hildenbrand
Tatashin Cc: Joonsoo Kim Cc: Thomas Gleixner Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 1 + include/linux/memory_hotplug.h | 2 ++ mm/memory_hotplug.c| 27 +-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a

[PATCH v1 07/10] mm/memory_hotplug: print only with DEBUG_VM in online/offline_pages()

2018-05-23 Thread David Hildenbrand
Let's try to minimze the noise. Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Dan Williams Cc: Reza Arbab Cc: Pavel Tatashin Cc: Thomas Gleixner Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH v1 05/10] mm/memory_hotplug: limit offline_pages() to sizes we can actually handle

2018-05-23 Thread David Hildenbrand
Cc: Greg Kroah-Hartman Cc: Pavel Tatashin Cc: Reza Arbab Cc: Thomas Gleixner Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 6 ++ mm/memory_hotplug.c| 22 ++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/include

[PATCH v1 06/10] mm/memory_hotplug: onlining pages can only fail due to notifiers

2018-05-23 Thread David Hildenbrand
: Thomas Gleixner Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 47 + 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index c971295a1100..8c0b7d85252b 100644 --- a/mm/memory_hotplug.c

[PATCH v1 01/10] mm: introduce and use PageOffline()

2018-05-23 Thread David Hildenbrand
tsuo Handa Signed-off-by: David Hildenbrand --- drivers/base/node.c| 1 - include/linux/memory.h | 1 - include/linux/mm.h | 10 ++ include/linux/page-flags.h | 9 + mm/memory_hotplug.c| 32 +++- mm/pag

[PATCH v1 04/10] kdump: include PAGE_OFFLINE_MAPCOUNT_VALUE in VMCOREINFO

2018-05-23 Thread David Hildenbrand
This allows dump tools to skip pages that are offline. Cc: Andrew Morton Cc: Dave Young Cc: Baoquan He Cc: Hari Bathini Cc: "Kirill A. Shutemov" Signed-off-by: David Hildenbrand --- kernel/crash_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/crash_core.

[PATCH v1 02/10] mm/page_ext.c: support online/offline of memory < section size

2018-05-23 Thread David Hildenbrand
sub sections. Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Oscar Salvador Cc: Kate Stewart Cc: Jaewon Kim Cc: Greg Kroah-Hartman Signed-off-by: David Hildenbrand --- mm/page_ext.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mm/page_ext.c b/mm

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