> Am 15.05.2015 um 16:27 schrieb Alex Bennée:
> > +++ b/arch/s390/include/uapi/asm/kvm.h
> > @@ -114,8 +114,6 @@ struct kvm_fpu {
> > __u64 fprs[16];
> > };
> >
> > -#define KVM_GUESTDBG_USE_HW_BP 0x0001
> [...]
> > +++ b/include/uapi/linux/kvm.h
> [...]
> > +#define KVM_GUEST
Whenever we have pagefaults disabled, we have to use the atomic variants of
(set|get)_user and copy_(from|to)_user.
Signed-off-by: David Hildenbrand
---
arch/powerpc/sysdev/fsl_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc
riants usually don't perform access checks
5. .*_inatomic variants don't call might_fault()
6. If common code uses the __.* variants, it has to trigger access_ok() and
call might_fault()
7. For pagefault_disable(), the inatomic variants are to be used
Comments? Opinions?
David Hilden
accessed while pagefault_disabled() is set, the atomic
variants of copy_(to|from)_user can be used.
This patch reverts commit 662bbcb2747c2422cf98d3d97619509379eee466 taking care
of the !MMU optimization.
Signed-off-by: David Hildenbrand
---
include/linux/kernel.h | 8 ++--
mm/memory.c
to me.
> On Tue, Nov 25, 2014 at 12:43:24PM +0100, David Hildenbrand wrote:
> > I recently discovered that commit 662bbcb2747c2422cf98d3d97619509379eee466
> > removed/skipped all might_sleep checks for might_fault() calls when in
> > atomic.
>
> Yes. You can add e.g.
> On Wed, Nov 26, 2014 at 05:17:29PM +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 26, 2014 at 11:05:04AM +0100, David Hildenbrand wrote:
> > > > What's the path you are trying to debug?
> > >
> > > Well, we had a problem where we held a spin_loc
> > This is what happened on our side (very recent kernel):
> >
> > spin_lock(&lock)
> > copy_to_user(...)
> > spin_unlock(&lock)
>
> That's a deadlock even without copy_to_user - it's
> enough for the thread to be preempted and another one
> to try taking the lock.
>
>
> > 1. s390 locks/unlock
> Code like
> spin_lock(&lock);
> if (copy_to_user(...))
> rc = ...
> spin_unlock(&lock);
> really *should* generate warnings like it did before.
>
> And *only* code like
> spin_lock(&lock);
Is only code like this valid or also with the spin_lock() dropped?
(
> On Thu, Nov 27, 2014 at 09:03:01AM +0100, David Hildenbrand wrote:
> > > Code like
> > > spin_lock(&lock);
> > > if (copy_to_user(...))
> > > rc = ...
> > > spin_unlock(&lock);
> > > really *should* genera
> OTOH, there is no reason why we need to disable preemption over that
> page_fault_disabled() region. There are code pathes which really do
> not require to disable preemption for that.
>
> We have that seperated in preempt-rt for obvious reasons and IIRC
> Peter Zijlstra tried to distangle it in
> From: David Hildenbrand
> ...
> > Although it might not be optimal, but keeping a separate counter for
> > pagefault_disable() as part of the preemption counter seems to be the only
> > doable thing right now. I am not sure if a completely separated counter is
> >
> From: David Hildenbrand [mailto:d...@linux.vnet.ibm.com]
> > > From: David Hildenbrand
> > > ...
> > > > Although it might not be optimal, but keeping a separate counter for
> > > > pagefault_disable() as part of the preemption counter seems to be the
imple atomic
context or in pagefault_disable() context.
Cleanup the PREEMPT_ACTIVE defines and fix the preempt count documentation on
the way.
Signed-off-by: David Hildenbrand
---
include/linux/preempt_mask.h | 24 +++-
include/linux/uaccess.h | 21 ++-
over/underflows
- Change documentation of user access methods to reflect the real behavior
- Don't touch the preempt counter, only the pagefault disable counter (future
work)
David Hildenbrand (2):
preempt: track pagefault_disable() calls in the preempt counter
mm, sched: trigger might_s
g care
of the !MMU optimization and the new pagefault_disabled() check.
Signed-off-by: David Hildenbrand
---
include/linux/kernel.h | 9 +++--
mm/memory.c| 15 ---
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kerne
> > > -
> > > - __might_sleep(__FILE__, __LINE__, 0);
> > > + if (unlikely(!pagefault_disabled()))
> > > + __might_sleep(__FILE__, __LINE__, 0);
> > >
>
> Same here: so maybe make might_fault a wrapper
> around __might_fault as well.
Yes, I also noticed that. It was part of the origin
> On Thu, 27 Nov 2014, David Hildenbrand wrote:
> > > OTOH, there is no reason why we need to disable preemption over that
> > > page_fault_disabled() region. There are code pathes which really do
> > > not require to disable preemption for that.
> > >
>
> On Tue, Nov 25, 2014 at 12:43:25PM +0100, David Hildenbrand wrote:
> > Whenever we have pagefaults disabled, we have to use the atomic variants of
> > (set|get)_user and copy_(from|to)_user.
> >
> > Signed-off-by: David Hildenbrand
> > ---
> > arch/powe
On 20.12.18 14:08, Michal Hocko wrote:
> On Thu 20-12-18 13:58:16, David Hildenbrand wrote:
>> On 30.11.18 18:59, David Hildenbrand wrote:
>>> This is the second approach, introducing more meaningful memory block
>>> types and not changing online behavior in the kernel
rnel.org
Cc: linux-s...@vger.kernel.org
Signed-off-by: David Hildenbrand
---
arch/ia64/mm/init.c| 11 +++
arch/powerpc/mm/mem.c | 11 ---
arch/s390/mm/init.c| 5 +++--
arch/sh/mm/init.c | 11 +++
arch/x86/mm/init_32.c
: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 9 +
include/linux/memory_hotplug.h | 6 +-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 6448c9ece2cb..8c5ce42c0fc3 100644
--- a/dr
Let's use a simple array which we can reuse soon. While at it, move the
string->mmop conversion out of the device hotplug lock.
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by:
as an array index.
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 11 ---
include/linux/memory_hotplug.h | 2 +-
2 fil
hotplug behavior configured
+PROGRAM=="grep online /sys/devices/system/memory/auto_online_blocks",
GOTO="memory_hotplug_end"
+
PROGRAM="/bin/uname -p", RESULT=="s390*", GOTO="memory_hotplug_end"
ENV{.state}="online"
===
[1] https://gi
Mackerras
Cc: Michael Ellerman
Cc: "K. Y. Srinivasan"
Cc: Haiyang Zhang
Cc: Stephen Hemminger
Cc: Wei Liu
Cc: Thomas Gleixner
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-hyp...@vger.kernel.org
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/powernv/memtrace.c | 2 +-
d
Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 11 +--
include/linux/memory_hotplug.h | 2 ++
mm/memory_hotplug.c
On 11.03.20 15:26, Wei Yang wrote:
> On Wed, Mar 11, 2020 at 01:30:26PM +0100, David Hildenbrand wrote:
>> For now, distributions implement advanced udev rules to essentially
>> - Don't online any hotplugged memory (s390x)
>> - Online all memory to ZONE_NORMAL (e.g., m
On 11.03.20 17:55, Vitaly Kuznetsov wrote:
> David Hildenbrand writes:
>
>> For now, distributions implement advanced udev rules to essentially
>> - Don't online any hotplugged memory (s390x)
>> - Online all memory to ZONE_NORMAL (e.g., most virt environments like
On 16.03.20 16:12, Michal Hocko wrote:
> On Wed 11-03-20 13:30:22, David Hildenbrand wrote:
>> The name is misleading. Let's just name it like the online_type name we
>> expose to user space ("online").
>
> I would disagree the name is misleading. It just say
On 16.03.20 16:24, Michal Hocko wrote:
> On Wed 11-03-20 13:30:25, David Hildenbrand wrote:
> [...]
>> diff --git a/arch/powerpc/platforms/powernv/memtrace.c
>> b/arch/powerpc/platforms/powernv/memtrace.c
>> index d6d64f8718e6..e15a600cfa4d 100644
>> --- a/
On 16.03.20 16:31, Michal Hocko wrote:
> On Wed 11-03-20 13:30:26, David Hildenbrand wrote:
>> For now, distributions implement advanced udev rules to essentially
>> - Don't online any hotplugged memory (s390x)
>> - Online all memory to ZONE_NORMAL (e.g., most virt env
otplug_end"
ACTION!="add", GOTO="memory_hotplug_end"
+# memory hotplug behavior configured
+PROGRAM=="grep online /sys/devices/system/memory/auto_online_blocks",
GOTO="memory_hotplug_end"
+
PROGRAM="/bin/uname -p", RESULT=="s390*
Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 9 +
include/linux/memory_hotplug.h | 6 +-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/bas
ot;-1", which didn't use the enum value.
This is a preparation to use the online_type as an array index.
Reviewed-by: Wei Yang
Acked-by: Michal Hocko
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Y
t;
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 38 +++---
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index e7e77cafef80..8a7f29c0bf97 100644
--- a/dri
socki"
Cc: Baoquan He
Cc: Wei Yang
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/powernv/memtrace.c | 14 --
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/memtrace.c
b/arch/powerpc/pl
"K. Y. Srinivasan"
Cc: Haiyang Zhang
Cc: Stephen Hemminger
Cc: Wei Liu
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Cc: Vitaly Kuznetsov
Cc: linux-hyp...@vger.kernel.org
Signed-off-by: D
All in-tree users except the mm-core are gone. Let's drop the export.
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
mm/memory_hotplug.c | 1 -
1 file changed, 1 deletion(-)
... and rename it to memhp_default_online_type. This is a preparation
for more detailed default online behavior.
Reviewed-by: Wei Yang
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off
memory block via
/sys/devices/system/memory/memoryX/state
Reviewed-by: Wei Yang
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 1
On 17.03.20 12:01, Michal Hocko wrote:
> On Tue 17-03-20 11:49:42, David Hildenbrand wrote:
>> For now, distributions implement advanced udev rules to essentially
>> - Don't online any hotplugged memory (s390x)
>> - Online all memory to ZONE_NORMAL (e.g., most virt env
On 17.03.20 11:49, David Hildenbrand wrote:
> For now, distributions implement advanced udev rules to essentially
> - Don't online any hotplugged memory (s390x)
> - Online all memory to ZONE_NORMAL (e.g., most virt environments like
> hyperv)
> - Online all memory to ZONE
On 17.03.20 17:29, Vitaly Kuznetsov wrote:
> David Hildenbrand writes:
>
>> We get the MEM_ONLINE notifier call if memory is added right from the
>> kernel via add_memory() or later from user space.
>>
>> Let's get rid of the "ha_waiting" flag - the w
> @@ -1707,6 +1701,7 @@ static int balloon_probe(struct hv_device *dev,
> #ifdef CONFIG_MEMORY_HOTPLUG
> set_online_page_callback(&hv_online_page);
> register_memory_notifier(&hv_memory_nb);
> + init_completion(&dm_device.ol_waitevent);
I'll move this one line up.
> #endif
>
>
On 18.03.20 14:05, Baoquan He wrote:
> On 03/17/20 at 11:49am, David Hildenbrand wrote:
>> Distributions nowadays use udev rules ([1] [2]) to specify if and
>> how to online hotplugged memory. The rules seem to get more complex with
>> many special cases. Due to the
Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 9 +
include/linux/memory_hotplug.h | 6 +-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/bas
uot;add", TEST=="online",
ATTR{online}=="0", ATTR{online}
# Memory hotadd request
SUBSYSTEM!="memory", GOTO="memory_hotplug_end"
ACTION!="add", GOTO="memory_hotplug_end"
+# memory hotplug behavior configured
+PROGRAM=="grep
ot;-1", which didn't use the enum value.
This is a preparation to use the online_type as an array index.
Reviewed-by: Wei Yang
Acked-by: Michal Hocko
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Y
t;
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 38 +++---
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index e7e77cafef80..8a7f29c0bf97 100644
--- a/dri
rtman
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/powernv/memtrace.c | 14 --
1 file changed, 4 insertions(+), 10 deletions(-)
di
All in-tree users except the mm-core are gone. Let's drop the export.
Reviewed-by: Wei Yang
Acked-by: Michal Hocko
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
mm/memory_hot
viewed-by: Vitaly Kuznetsov
Cc: "K. Y. Srinivasan"
Cc: Haiyang Zhang
Cc: Stephen Hemminger
Cc: Wei Liu
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Cc: Vitaly Kuznetsov
Cc: linux-hyp...@vger.kernel.or
: Wei Yang
Signed-off-by: David Hildenbrand
---
drivers/base/memory.c | 10 --
include/linux/memory_hotplug.h | 3 ++-
mm/memory_hotplug.c| 11 ++-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memo
memory block via
/sys/devices/system/memory/memoryX/state
Reviewed-by: Wei Yang
Acked-by: Michal Hocko
Cc: Greg Kroah-Hartman
Cc: Andrew Morton
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: "Rafael J. Wysocki"
Cc: Baoquan He
Cc: Wei Yang
Signed-off-by: David Hildenbrand
---
d
On 20.03.20 08:36, Baoquan He wrote:
> On 03/19/20 at 02:12pm, David Hildenbrand wrote:
>> Let's use a simple array which we can reuse soon. While at it, move the
>> string->mmop conversion out of the device hotplug lock.
>>
>> Reviewed-by: Wei Yang
>>
r vmmemap mapping
> (16MB),
> a specific vmemmap mapping can cover multiple sections. Hence before a vmemmap
> mapping page can be freed, the kernel needs to make sure there are no valid
> sections
> within that mapping. Clearing the section valid bit before
> depopulate_section_memap enables t
Cc: "H. Peter Anvin"
Cc: KarimAllah Ahmed
Cc: Michal Hocko
Cc: Dan Williams
Signed-off-by: David Hildenbrand
---
arch/x86/kvm/mmu.c | 30 ++
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 2
accessed).
Cc: Paolo Bonzini
Cc: "Radim Krčmář"
Cc: Michal Hocko
Cc: Dan Williams
Cc: KarimAllah Ahmed
Signed-off-by: David Hildenbrand
---
virt/kvm/kvm_main.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_ma
-by: David Hildenbrand
---
mm/memory_hotplug.c | 26 --
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 561371ead39a..7210f4375279 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1447,10 +1447,19
"
Cc: Dan Carpenter
Cc: Nishka Dasgupta
Cc: Madhumitha Prabakaran
Cc: Fabio Estevam
Cc: Matt Sickler
Cc: Jeremy Sowden
Signed-off-by: David Hildenbrand
---
drivers/staging/kpc2000/kpc_dma/fileops.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/
-by: David Hildenbrand
---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c
b/arch/powerpc/kvm/book3s_64_mmu_radix.c
index 2d415c36a61d..05397c0561fc 100644
--- a/arch/powerpc/kvm
accessed).
Cc: Alex Williamson
Cc: Cornelia Huck
Signed-off-by: David Hildenbrand
---
drivers/vfio/vfio_iommu_type1.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 2ada8e6cdb88
Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: "Aneesh Kumar K.V"
Cc: Christophe Leroy
Cc: Nicholas Piggin
Cc: Andrew Morton
Cc: Mike Rapoport
Cc: YueHaibing
Signed-off-by: David Hildenbrand
---
arch/powerpc/mm/book3s64/hash_utils.c | 10 ++
1 file changed, 6
rtman
Signed-off-by: David Hildenbrand
---
drivers/staging/gasket/gasket_page_table.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/gasket/gasket_page_table.c
b/drivers/staging/gasket/gasket_page_table.c
index f6d715787da8..d43fed58bf65 100644
--- a/drivers/st
Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Christophe Leroy
Cc: "Aneesh Kumar K.V"
Cc: Allison Randal
Cc: Nicholas Piggin
Cc: Thomas Gleixner
Signed-off-by: David Hildenbrand
---
arch/powerpc/mm/pgtable.c | 10 ++
1 file changed, 6 insertions(+), 4 deletion
Cc: Andy Lutomirski
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: Borislav Petkov
Cc: "H. Peter Anvin"
Signed-off-by: David Hildenbrand
---
arch/x86/mm/ioremap.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/ioremap.c
n Khandual
Suggested-by: Michal Hocko
Signed-off-by: David Hildenbrand
---
drivers/hv/hv_balloon.c| 6 ++
drivers/xen/balloon.c | 7 +++
include/linux/page-flags.h | 8 +---
mm/memory_hotplug.c| 17 +++--
mm/page_alloc.c| 11 --
tps://lkml.org/lkml/2019/10/21/736
[2] https://lkml.org/lkml/2019/10/21/1034
Cc: Michal Hocko
Cc: Dan Williams
Cc: kvm-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: k...@vger.kernel.org
Cc: linux-hyp...@vger.kernel.org
Cc: de...@driverdev.osuosl.org
Cc: xen-de...@lists.xenpr
ecks).
Cc: Kees Cook
Cc: Andrew Morton
Cc: Kate Stewart
Cc: Allison Randal
Cc: "Isaac J. Manjarres"
Cc: Qian Cai
Cc: Thomas Gleixner
Signed-off-by: David Hildenbrand
---
mm/usercopy.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/usercopy.c b
On 22.10.19 19:55, Matt Sickler wrote:
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that.
The pages are obtained via get_user_pages_fast(). I assume, these could be
ZONE_DEVICE pages. Let's just exclude them as well explicitly.
I'm not sure what ZONE_DEVICE pages
On 22.10.19 23:54, Dan Williams wrote:
> Hi David,
>
> Thanks for tackling this!
Thanks for having a look :)
[...]
>> I am probably a little bit too careful (but I don't want to break things).
>> In most places (besides KVM and vfio that are nuts), the
>> pfn_to_online_page() check could most
On 22.10.19 19:12, David Hildenbrand wrote:
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to
change that.
The pages are obtained via get_user_pages_fast(). I assume, these
could be ZONE_DEVICE pages. Let's just exclude them as well explicitly.
Cc: Rob Springer
Cc:
On 22.10.19 19:12, David Hildenbrand wrote:
Right now, ZONE_DEVICE memory is always set PG_reserved. We want to
change that.
Let's make sure that the logic in the function won't change. Once we no
longer set these pages to reserved, we can rework this function to
perform separate
On 23.10.19 18:25, Kees Cook wrote:
> On Wed, Oct 23, 2019 at 10:20:14AM +0200, David Hildenbrand wrote:
>> On 22.10.19 19:12, David Hildenbrand wrote:
>>> Right now, ZONE_DEVICE memory is always set PG_reserved. We want to
>>> change that.
>>>
>>> L
>> I dislike this for three reasons
>>
>> a) It does not protect against any races, really, it does not improve things.
>> b) We do have the exact same problem with pfn_to_online_page(). As long as we
>>don't hold the memory hotplug lock, memory can get offlined and remove
>> any time. Racy.
>
On 23.10.19 21:39, Dan Williams wrote:
> On Wed, Oct 23, 2019 at 10:28 AM David Hildenbrand wrote:
>>
>>>> I dislike this for three reasons
>>>>
>>>> a) It does not protect against any races, really, it does not improve
>>>&g
On 24.10.19 05:53, Anshuman Khandual wrote:
On 10/22/2019 10:42 PM, David Hildenbrand wrote:
Our onlining/offlining code is unnecessarily complicated. Only memory
blocks added during boot can have holes. Hotplugged memory never has
holes. That memory is already online.
Why hot plugged memory
: Dan Williams
Cc: kvm-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: k...@vger.kernel.org
Cc: linux-hyp...@vger.kernel.org
Cc: de...@driverdev.osuosl.org
Cc: xen-de...@lists.xenproject.org
Cc: x...@kernel.org
Cc: Alexander Duyck
David Hildenbrand (10):
mm/memory_hotplug: Don't allow to o
: Michal Hocko
Cc: Oscar Salvador
Cc: Pavel Tatashin
Cc: Dan Williams
Cc: Anshuman Khandual
Signed-off-by: David Hildenbrand
---
mm/memory_hotplug.c | 26 --
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index
Wanpeng Li
Cc: Jim Mattson
Cc: Joerg Roedel
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: Borislav Petkov
Cc: "H. Peter Anvin"
Cc: KarimAllah Ahmed
Cc: Michal Hocko
Cc: Dan Williams
Signed-off-by: David Hildenbrand
---
arch/x86/kvm/mmu.c | 29 +
1 file chan
arimAllah Ahmed
Signed-off-by: David Hildenbrand
---
virt/kvm/kvm_main.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index e9eb666eb6e8..9d18cc67d124 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -151,9 +151,1
have an initialized memmap (and don't have ZONE_DEVICE memory).
Rewrite is_invalid_reserved_pfn() similar to kvm_is_reserved_pfn() to make
sure the function produces the same result once we stop setting ZONE_DEVICE
pages PG_reserved.
Cc: Alex Williamson
Cc: Cornelia Huck
Signed-off-by:
t
Cc: Michael Ellerman
Signed-off-by: David Hildenbrand
---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c
b/arch/powerpc/kvm/book3s_64_mmu_radix.c
index 2d415c36a61d..05397c0561fc 100644
: "Aneesh Kumar K.V"
Cc: Christophe Leroy
Cc: Nicholas Piggin
Cc: Andrew Morton
Cc: Mike Rapoport
Cc: YueHaibing
Signed-off-by: David Hildenbrand
---
arch/powerpc/mm/book3s64/hash_utils.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/m
Leroy
Cc: "Aneesh Kumar K.V"
Cc: Allison Randal
Cc: Nicholas Piggin
Cc: Thomas Gleixner
Signed-off-by: David Hildenbrand
---
arch/powerpc/mm/pgtable.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtab
: Ingo Molnar
Cc: Borislav Petkov
Cc: "H. Peter Anvin"
Signed-off-by: David Hildenbrand
---
arch/x86/mm/ioremap.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index a39dcdb5ae34..db6913b48edf 100644
Weiner
Cc: Anthony Yznaga
Cc: Michal Hocko
Cc: Oscar Salvador
Cc: Dan Williams
Cc: Mel Gorman
Cc: Mike Rapoport
Cc: Anshuman Khandual
Cc: Matt Sickler
Cc: Kees Cook
Suggested-by: Michal Hocko
Signed-off-by: David Hildenbrand
---
drivers/hv/hv_balloon.c| 6 ++
drivers/xen/balloon.
Cc: Thomas Gleixner
Signed-off-by: David Hildenbrand
---
mm/usercopy.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 660717a1ea5c..80f254024c97 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -199,9 +199,9 @@ static inline void check_
On 23.10.19 09:26, David Hildenbrand wrote:
On 22.10.19 23:54, Dan Williams wrote:
Hi David,
Thanks for tackling this!
Thanks for having a look :)
[...]
I am probably a little bit too careful (but I don't want to break things).
In most places (besides KVM and vfio that are nuts)
On 06.10.19 10:56, David Hildenbrand wrote:
We currently try to shrink a single zone when removing memory. We use the
zone of the first page of the memory we are removing. If that memmap was
never initialized (e.g., memory was never onlined), we will read garbage
and can trigger kernel BUGs (due
Greg Kroah-Hartman
Cc: Thomas Gleixner
Cc: Arun KS
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/cmm.c
b/arch/powerpc/platforms/pseries/cmm.c
index b33251d75927..572651a5c87b 100644
If we don't set the rc, we will return "0", making it look like we
succeeded.
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Andrew Morton
Cc: Pavel Tatashin
Cc: Richard Fontana
Cc: Allison Randal
Cc: Thomas Gleixner
Cc: Arun KS
Signed-off-by: Da
d test with actual HW that has this feature.
Cc: Alexander Duyck
Cc: Alexander Potapenko
Cc: Alexey Kardashevskiy
Cc: Allison Randal
Cc: Andrew Morton
Cc: Anshuman Khandual
Cc: Anshuman Khandual
Cc: Arun KS
Cc: Benjamin Herrenschmidt
Cc: Christian Brauner
Cc: Dan Williams
Cc: David Hildenbr
No need to initialize rc. Also, let's return 0 directly when succeeding.
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Michal Hocko
Cc: Konstantin Khlebnikov
Cc: Andrew Morton
Cc: Arun KS
Cc: Thomas Gleixner
Signed-off-by: David Hilden
: Thomas Gleixner
Cc: Arun KS
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 163 ++-
1 file changed, 36 insertions(+), 127 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/cmm.c
b/arch/powerpc/platforms/pseries/cmm.c
index 738e
ashin
Cc: Richard Fontana
Cc: Allison Randal
Cc: Thomas Gleixner
Cc: Arun KS
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/cmm.c
b/arch/powerpc/platforms/ps
Mackerras
Cc: Michael Ellerman
Cc: Andrew Morton
Cc: Pavel Tatashin
Cc: Richard Fontana
Cc: Allison Randal
Cc: Thomas Gleixner
Cc: Arun KS
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 97 +---
1 file changed, 1 insertion(+), 96 deletion
thread and a concurrent OOM notifier.
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Andrew Morton
Cc: Pavel Tatashin
Cc: Richard Fontana
Cc: Allison Randal
Cc: Thomas Gleixner
Cc: Arun KS
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 35
ristian Brauner
Cc: Gao Xiang
Cc: Greg Hackmann
Cc: David Howells
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/Kconfig | 1 +
arch/powerpc/platforms/pseries/cmm.c | 132 ++---
include/uapi/linux/magic.h | 1 +
3 files changed, 120 inse
: Arun KS
Signed-off-by: David Hildenbrand
---
arch/powerpc/platforms/pseries/cmm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/cmm.c
b/arch/powerpc/platforms/pseries/cmm.c
index 235fd7fe9df1..a6ec2bbb1f91 100644
--- a/arch/powerpc
1 - 100 of 1175 matches
Mail list logo