* Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()
From: David Hildenbrand @ 2020-02-04 14:42 UTC (permalink / raw)
To: Baoquan He
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel, Oscar Salvador
In-Reply-To: <20200204142516.GD26758@MiWiFi-R3L-srv>
On 04.02.20 15:25, Baoquan He wrote:
> On 10/06/19 at 10:56am, David Hildenbrand wrote:
>> If we have holes, the holes will automatically get detected and removed
>> once we remove the next bigger/smaller section. The extra checks can
>> go.
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Oscar Salvador <osalvador@suse.de>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: Wei Yang <richardw.yang@linux.intel.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>> mm/memory_hotplug.c | 34 +++++++---------------------------
>> 1 file changed, 7 insertions(+), 27 deletions(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index f294918f7211..8dafa1ba8d9f 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -393,6 +393,9 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
>> if (pfn) {
>> zone->zone_start_pfn = pfn;
>> zone->spanned_pages = zone_end_pfn - pfn;
>> + } else {
>> + zone->zone_start_pfn = 0;
>> + zone->spanned_pages = 0;
>> }
>> } else if (zone_end_pfn == end_pfn) {
>> /*
>> @@ -405,34 +408,11 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
>> start_pfn);
>> if (pfn)
>> zone->spanned_pages = pfn - zone_start_pfn + 1;
>> + else {
>> + zone->zone_start_pfn = 0;
>> + zone->spanned_pages = 0;
>
> Thinking in which case (zone_start_pfn != start_pfn) and it comes here.
Could only happen in case the zone_start_pfn would have been "out of the
zone already". If you ask me: unlikely :)
This change at least maintains the same result as before (where the
all-holes check would have caught it).
--
Thanks,
David / dhildenb
^ permalink raw reply
* Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()
From: David Hildenbrand @ 2020-02-04 13:38 UTC (permalink / raw)
To: Segher Boessenkool
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel, Oscar Salvador
In-Reply-To: <20200204131353.GJ22482@gate.crashing.org>
On 04.02.20 14:13, Segher Boessenkool wrote:
> On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote:
>> On 04.02.20 10:46, Oscar Salvador wrote:
>>> I have to confess that it took me while to wrap around my head
>>> with the new min() change, but looks ok:
>>
>> It's a pattern commonly used in compilers and emulators to calculate the
>> number of bytes to the next block/alignment. (we're missing a macro
>> (like we have ALIGN_UP/IS_ALIGNED) for that - but it's hard to come up
>> with a good name (e.g., SIZE_TO_NEXT_ALIGN) .
>
> You can just write the easy to understand
>
> ... ALIGN_UP(x) - x ...
you mean
ALIGN_UP(x, PAGES_PER_SECTION) - x
but ...
>
> which is better *without* having a separate name. Does that not
> generate good machine code for you?
1. There is no ALIGN_UP. "SECTION_ALIGN_UP(x) - x" would be possible
2. It would be wrong if x is already aligned.
e.g., let's use 4096 for simplicity as we all know that value by heart
(for both x and the block size).
a) -(4096 | -4096) -> 4096
b) #define ALIGN_UP(x, a) ((x + a - 1) & -(a))
ALIGN_UP(4096, 4096) - 4096 -> 0
Not as easy as it seems ...
--
Thanks,
David / dhildenb
^ permalink raw reply
* Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.6-1 tag
From: pr-tracker-bot @ 2020-02-04 13:25 UTC (permalink / raw)
To: Michael Ellerman
Cc: aik, jniethe5, bigeasy, linuxram, kernelfans, oohall, sukadev,
shawn, alex, aneesh.kumar, krzk, chenzhou10, anju, joel, byj.tea,
sukadev, ajd, groug, npiggin, oss, tyreld, natechancellor,
laurentiu.tudor, peter.ujfalusi, timur, Linus Torvalds, rdunlap,
mwb, linux-kernel, Julia.Lawall, fbarrat, vaibhav, linuxppc-dev
In-Reply-To: <878sli3640.fsf@mpe.ellerman.id.au>
The pull request you sent on Tue, 04 Feb 2020 23:10:55 +1100:
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.6-1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/71c3a888cbcaf453aecf8d2f8fb003271d28073f
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker
^ permalink raw reply
* Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()
From: Segher Boessenkool @ 2020-02-04 13:13 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel, Oscar Salvador
In-Reply-To: <5d698f94-af18-0714-bc97-14b6c520572c@redhat.com>
On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote:
> On 04.02.20 10:46, Oscar Salvador wrote:
> > I have to confess that it took me while to wrap around my head
> > with the new min() change, but looks ok:
>
> It's a pattern commonly used in compilers and emulators to calculate the
> number of bytes to the next block/alignment. (we're missing a macro
> (like we have ALIGN_UP/IS_ALIGNED) for that - but it's hard to come up
> with a good name (e.g., SIZE_TO_NEXT_ALIGN) .
You can just write the easy to understand
... ALIGN_UP(x) - x ...
which is better *without* having a separate name. Does that not
generate good machine code for you?
Segher
^ permalink raw reply
* Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()
From: David Hildenbrand @ 2020-02-04 12:41 UTC (permalink / raw)
To: Oscar Salvador
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20200204094652.GE6494@linux>
On 04.02.20 10:46, Oscar Salvador wrote:
> On Sun, Oct 06, 2019 at 10:56:46AM +0200, David Hildenbrand wrote:
>> Let's drop the basically unused section stuff and simplify.
>>
>> Also, let's use a shorter variant to calculate the number of pages to
>> the next section boundary.
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Oscar Salvador <osalvador@suse.de>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: Wei Yang <richardw.yang@linux.intel.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>
> I have to confess that it took me while to wrap around my head
> with the new min() change, but looks ok:
It's a pattern commonly used in compilers and emulators to calculate the
number of bytes to the next block/alignment. (we're missing a macro
(like we have ALIGN_UP/IS_ALIGNED) for that - but it's hard to come up
with a good name (e.g., SIZE_TO_NEXT_ALIGN) .
--
Thanks,
David / dhildenb
^ permalink raw reply
* [GIT PULL] Please pull powerpc/linux.git powerpc-5.6-1 tag
From: Michael Ellerman @ 2020-02-04 12:10 UTC (permalink / raw)
To: Linus Torvalds
Cc: aik, jniethe5, bigeasy, linuxram, kernelfans, oohall, sukadev,
shawn, alex, aneesh.kumar, krzk, chenzhou10, anju, joel, byj.tea,
sukadev, ajd, groug, npiggin, oss, tyreld, natechancellor,
laurentiu.tudor, peter.ujfalusi, timur, rdunlap, mwb,
linux-kernel, Julia.Lawall, fbarrat, vaibhav, linuxppc-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Linus,
Please pull powerpc updates for 5.6.
A pretty small batch for us, and apologies for it being a bit late, I wanted to
sneak Christophe's user_access_begin() series in.
No conflicts or other issues I'm aware of.
cheers
The following changes since commit c79f46a282390e0f5b306007bf7b11a46d529538:
Linux 5.5-rc5 (2020-01-05 14:23:27 -0800)
are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.6-1
for you to fetch changes up to 4c25df5640ae6e4491ee2c50d3f70c1559ef037d:
Merge branch 'topic/user-access-begin' into next (2020-02-01 21:47:17 +1100)
- ------------------------------------------------------------------
powerpc updates for 5.6
- Implement user_access_begin() and friends for our platforms that support
controlling kernel access to userspace.
- Enable CONFIG_VMAP_STACK on 32-bit Book3S and 8xx.
- Some tweaks to our pseries IOMMU code to allow SVMs ("secure" virtual
machines) to use the IOMMU.
- Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE to the 32-bit VDSO, and
some other improvements.
- A series to use the PCI hotplug framework to control opencapi card's so that
they can be reset and re-read after flashing a new FPGA image.
As well as other minor fixes and improvements as usual.
Thanks to:
Alastair D'Silva, Alexandre Ghiti, Alexey Kardashevskiy, Andrew Donnellan,
Aneesh Kumar K.V, Anju T Sudhakar, Bai Yingjie, Chen Zhou, Christophe Leroy,
Frederic Barrat, Greg Kurz, Jason A. Donenfeld, Joel Stanley, Jordan Niethe,
Julia Lawall, Krzysztof Kozlowski, Laurent Dufour, Laurentiu Tudor, Linus
Walleij, Michael Bringmann, Nathan Chancellor, Nicholas Piggin, Nick
Desaulniers, Oliver O'Halloran, Peter Ujfalusi, Pingfan Liu, Ram Pai, Randy
Dunlap, Russell Currey, Sam Bobroff, Sebastian Andrzej Siewior, Shawn
Anastasio, Stephen Rothwell, Steve Best, Sukadev Bhattiprolu, Thiago Jung
Bauermann, Tyrel Datwyler, Vaibhav Jain.
- ------------------------------------------------------------------
Alexandre Ghiti (1):
powerpc: Do not consider weak unresolved symbol relocations as bad
Alexey Kardashevskiy (3):
powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW
powerpc/pseries/iommu: Separate FW_FEATURE_MULTITCE to put/stuff features
powerpc/pseries/svm: Allow IOMMU to work in SVM
Aneesh Kumar K.V (2):
powerpc/papr_scm: Update debug message
powerpc/papr_scm: Don't enable direct map for a region by default
Anju T Sudhakar (1):
powerpc/imc: Add documentation for IMC and trace-mode
Bai Yingjie (2):
powerpc32/booke: consistently return phys_addr_t in __pa()
powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry
Chen Zhou (1):
powerpc/maple: Fix comparing pointer to 0
Christophe Leroy (47):
powerpc/ptdump: don't entirely rebuild kernel when selecting CONFIG_PPC_DEBUG_WX
powerpc/ptdump: Fix W+X verification call in mark_rodata_ro()
powerpc/ptdump: Fix W+X verification
powerpc/ptdump: Only enable PPC_CHECK_WX with STRICT_KERNEL_RWX
powerpc/8xx: Fix permanently mapped IMMR region.
powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.
selftests/powerpc: Enable range tests on 8xx in ptrace-hwbreak.c selftest
powerpc/devicetrees: Change 'gpios' to 'cs-gpios' on fsl, spi nodes
powerpc/32: Add VDSO version of getcpu on non SMP
powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE
powerpc/vdso32: inline __get_datapage()
powerpc/vdso32: Don't read cache line size from the datapage on PPC32.
powerpc/vdso32: use LOAD_REG_IMMEDIATE()
powerpc/vdso32: implement clock_getres entirely
powerpc/vdso32: miscellaneous optimisations
powerpc: use probe_user_read() and probe_user_write()
powerpc/32: replace MTMSRD() by mtmsr
powerpc/32: Add EXCEPTION_PROLOG_0 in head_32.h
powerpc/32: save DEAR/DAR before calling handle_page_fault
powerpc/32: move MSR_PR test into EXCEPTION_PROLOG_0
powerpc/32: add a macro to get and/or save DAR and DSISR on stack.
powerpc/32: prepare for CONFIG_VMAP_STACK
powerpc: align stack to 2 * THREAD_SIZE with VMAP_STACK
powerpc/32: Add early stack overflow detection with VMAP stack.
powerpc/32: Use vmapped stacks for interrupts
powerpc/8xx: Use alternative scratch registers in DTLB miss handler
powerpc/8xx: Drop exception entries for non-existing exceptions
powerpc/8xx: Move DataStoreTLBMiss perf handler
powerpc/8xx: Split breakpoint exception
powerpc/8xx: Enable CONFIG_VMAP_STACK
powerpc/32s: Reorganise DSI handler.
powerpc/32s: Avoid crossing page boundary while changing SRR0/1.
powerpc/32s: Enable CONFIG_VMAP_STACK
powerpc/mm: Don't log user reads to 0xffffffff
powerpc/32: Add support of KASAN_VMALLOC
powerpc/kconfig: Move CONFIG_PPC32 into Kconfig.cputype
powerpc/32: Force KASAN_VMALLOC for modules
powerpc/32: Simplify KASAN init
powerpc/32: Reuse orphaned memblocks in kasan_init_shadow_page_tables()
powerpc/32s: Fix CPU wake-up from sleep mode
powerpc/32s: Fix bad_kuap_fault()
powerpc/kuap: Fix set direction in allow/prevent_user_access()
powerpc/32s: Drop NULL addr verification
powerpc/32s: Prepare prevent_user_access() for user_access_end()
powerpc: Implement user_access_begin and friends
powerpc: Implement user_access_save() and user_access_restore()
powerpc/32s: Fix kasan_early_hash_table() for CONFIG_VMAP_STACK
Frederic Barrat (11):
powerpc/powernv/ioda: Fix ref count for devices with their own PE
powerpc/powernv/ioda: Protect PE list
powerpc/powernv/ioda: set up PE on opencapi device when enabling
powerpc/powernv/ioda: Release opencapi device
powerpc/powernv/ioda: Find opencapi slot for a device node
pci/hotplug/pnv-php: Remove erroneous warning
pci/hotplug/pnv-php: Improve error msg on power state change failure
pci/hotplug/pnv-php: Register opencapi slots
pci/hotplug/pnv-php: Relax check when disabling slot
pci/hotplug/pnv-php: Wrap warnings in macro
ocxl: Add PCI hotplug dependency to Kconfig
Greg Kurz (2):
KVM: PPC: Book3S HV: XIVE: Fix typo in comment
powerpc/xive: Drop extern qualifiers from header function prototypes
Joel Stanley (1):
powerpc/configs/skiroot: Enable security features
Jordan Niethe (2):
powerpc/64: Use {SAVE,REST}_NVGPRS macros
powerpc/mm: Remove kvm radix prefetch workaround for Power9 DD2.2
Julia Lawall (4):
powerpc/mpic: constify copied structure
powerpc/83xx: use resource_size
powerpc/powernv: use resource_size
misc: cxl: use mmgrab
Krzysztof Kozlowski (2):
macintosh: Fix Kconfig indentation
powerpc: configs: Cleanup old Kconfig options
Laurentiu Tudor (1):
MAINTAINERS: Add myself as maintainer of ehv_bytechan tty driver
Michael Bringmann (1):
powerpc/pseries/lparcfg: Fix display of Maximum Memory
Michael Ellerman (12):
selftests/powerpc: Add a test of bad (out-of-range) accesses
powerpc/pseries: Remove redundant select of PPC_DOORBELL
powerpc/8xx: Move tail of alignment exception out of line
powerpc/configs: Drop CONFIG_QLGE which moved to staging
powerpc/configs: NET_CADENCE became NET_VENDOR_CADENCE
powerpc/configs: Drop NET_VENDOR_HP which moved to staging
powerpc/configs/skiroot: Drop HID_LOGITECH
powerpc/configs/skiroot: Drop default n CONFIG_CRYPTO_ECHAINIV
powerpc/configs/skiroot: Update for symbol movement only
powerpc/configs/skiroot: Disable xmon default & enable reboot on panic
powerpc/configs/skiroot: Enable some more hardening options
Merge branch 'topic/user-access-begin' into next
Nathan Chancellor (1):
powerpc/44x: Adjust indentation in ibm4xx_denali_fixup_memsize
Nicholas Piggin (1):
powerpc/64s: Reimplement power4_idle code in C
Oliver O'Halloran (24):
powerpc/powernv/iov: Ensure the pdn for VFs always contains a valid PE number
powerpc/pci: Remove pcibios_setup_bus_devices()
powerpc/eeh_cache: Don't use pci_dn when inserting new ranges
powerpc/eeh_sysfs: Fix incorrect comment
powerpc/eeh_sysfs: ifdef pseries sr-iov sysfs properties
powerpc/eeh_sysfs: Remove double pci_dn lookup.
powerpc/eeh_sysfs: Make clearing EEH_DEV_SYSFS saner
powerpc/sriov: Remove VF eeh_dev state when disabling SR-IOV
powerpc/pcidn: Make VF pci_dn management CONFIG_PCI_IOV specific
powerpc/pcidn: Warn when sriov pci_dn management is used incorrectly
powernv/pci: Use pnv_phb as the private data for debugfs entries
powernv/pci: Allow any write trigger the diag dump
powernv/pci: Add a debugfs entry to dump PHB's IODA PE state
powerpc/eeh: Only dump stack once if an MMIO loop is detected
powerpc/powernv: Rework exports to support subnodes
powerpc/powernv: Use common code for the symbol_map export
powerpc/xmon: Allow passing an argument to ppc_md.restart()
powerpc/powernv: Allow manually invoking special reboots
powerpc/pci: Fold pcibios_setup_device() into pcibios_bus_add_device()
powernv/pci: Remove dma_dev_setup() for NPU PHBs
powerpc/iov: Move VF pdev fixup into pcibios_fixup_iov()
powernv/pci: Fold pnv_pci_dma_dev_setup() into the pci-ioda.c version
powernv/pci: Move pnv_pci_dma_bus_setup() to pci-ioda.c
selftests/eeh: Bump EEH wait time to 60s
Peter Ujfalusi (1):
powerpc/512x: Use dma_request_chan() instead dma_request_slave_channel()
Pingfan Liu (1):
powerpc/pseries: Advance pfn if section is not present in lmb_is_removable()
Ram Pai (1):
Revert "powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests"
Randy Dunlap (1):
powerpc: indent to improve Kconfig readability
Russell Currey (2):
powerpc/book3s64/hash: Disable 16M linear mapping size if not aligned
powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE
Sebastian Andrzej Siewior (1):
powerpc/85xx: Get twr_p102x to compile again
Shawn Anastasio (1):
powerpc/pci: Fix pcibios_setup_device() ordering
Sukadev Bhattiprolu (2):
powerpc/xmon: don't access ASDR in VMs
powerpc/xmon: Fix compile error in print_insn* functions
Tyrel Datwyler (1):
powerpc/pseries/vio: Fix iommu_table use-after-free refcount warning
Vaibhav Jain (2):
powerpc/papr_scm: Fix leaking 'bus_desc.provider_name' in some paths
powerpc: Provide initial documentation for PAPR hcalls
Documentation/devicetree/bindings/spi/fsl-spi.txt | 8 +-
Documentation/powerpc/imc.rst | 199 ++++++++++++++++
Documentation/powerpc/index.rst | 2 +
Documentation/powerpc/papr_hcalls.rst | 250 ++++++++++++++++++++
arch/powerpc/Kconfig | 9 +-
arch/powerpc/Kconfig.debug | 2 +-
arch/powerpc/Makefile.postlink | 4 +-
arch/powerpc/boot/4xx.c | 2 +-
arch/powerpc/boot/dts/mgcoge.dts | 2 +-
arch/powerpc/boot/dts/mpc832x_rdb.dts | 2 +-
arch/powerpc/boot/dts/mpc8610_hpcd.dts | 2 +-
arch/powerpc/configs/44x/akebono_defconfig | 1 -
arch/powerpc/configs/44x/sam440ep_defconfig | 2 -
arch/powerpc/configs/52xx/pcm030_defconfig | 2 -
arch/powerpc/configs/83xx/kmeter1_defconfig | 2 -
arch/powerpc/configs/adder875_defconfig | 1 -
arch/powerpc/configs/ep8248e_defconfig | 1 -
arch/powerpc/configs/ep88xc_defconfig | 1 -
arch/powerpc/configs/mgcoge_defconfig | 1 -
arch/powerpc/configs/mpc512x_defconfig | 1 -
arch/powerpc/configs/mpc885_ads_defconfig | 1 -
arch/powerpc/configs/powernv_defconfig | 1 -
arch/powerpc/configs/ppc64_defconfig | 1 -
arch/powerpc/configs/ppc6xx_defconfig | 1 -
arch/powerpc/configs/pseries_defconfig | 1 -
arch/powerpc/configs/skiroot_defconfig | 68 +++---
arch/powerpc/configs/storcenter_defconfig | 1 -
arch/powerpc/configs/tqm8xx_defconfig | 1 -
arch/powerpc/include/asm/book3s/32/kup.h | 68 +++++-
arch/powerpc/include/asm/book3s/32/pgtable.h | 5 +
arch/powerpc/include/asm/book3s/64/kup-radix.h | 40 +++-
arch/powerpc/include/asm/cputable.h | 7 +-
arch/powerpc/include/asm/firmware.h | 6 +-
arch/powerpc/include/asm/hw_breakpoint.h | 4 +
arch/powerpc/include/asm/kasan.h | 2 +
arch/powerpc/include/asm/kup.h | 49 +++-
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 21 +-
arch/powerpc/include/asm/nohash/32/pgtable.h | 5 +
arch/powerpc/include/asm/page.h | 2 +-
arch/powerpc/include/asm/pci-bridge.h | 7 +-
arch/powerpc/include/asm/pci.h | 1 -
arch/powerpc/include/asm/pgtable.h | 6 -
arch/powerpc/include/asm/pnv-pci.h | 1 +
arch/powerpc/include/asm/processor.h | 9 +
arch/powerpc/include/asm/reg_8xx.h | 14 ++
arch/powerpc/include/asm/thread_info.h | 18 ++
arch/powerpc/include/asm/uaccess.h | 88 +++++--
arch/powerpc/include/asm/vdso_datapage.h | 14 +-
arch/powerpc/include/asm/xive.h | 92 +++----
arch/powerpc/kernel/Makefile | 3 +-
arch/powerpc/kernel/asm-offsets.c | 11 +-
arch/powerpc/kernel/dt_cpu_ftrs.c | 13 +-
arch/powerpc/kernel/eeh.c | 32 +--
arch/powerpc/kernel/eeh_cache.c | 10 +-
arch/powerpc/kernel/eeh_driver.c | 6 -
arch/powerpc/kernel/eeh_sysfs.c | 22 +-
arch/powerpc/kernel/entry_32.S | 32 ++-
arch/powerpc/kernel/entry_64.S | 18 +-
arch/powerpc/kernel/exceptions-64s.S | 32 ++-
arch/powerpc/kernel/fpu.S | 3 +
arch/powerpc/kernel/head_32.S | 62 +++--
arch/powerpc/kernel/head_32.h | 180 ++++++++++++--
arch/powerpc/kernel/head_40x.S | 2 +
arch/powerpc/kernel/head_8xx.S | 189 +++++++--------
arch/powerpc/kernel/head_booke.h | 2 +
arch/powerpc/kernel/head_fsl_booke.S | 1 +
arch/powerpc/kernel/hw_breakpoint.c | 15 +-
arch/powerpc/kernel/idle.c | 25 ++
arch/powerpc/kernel/idle_book3s.S | 20 ++
arch/powerpc/kernel/idle_power4.S | 83 -------
arch/powerpc/kernel/irq.c | 22 ++
arch/powerpc/kernel/pci-common.c | 46 +---
arch/powerpc/kernel/pci-hotplug.c | 1 -
arch/powerpc/kernel/pci_dn.c | 47 ++--
arch/powerpc/kernel/pci_of_scan.c | 1 -
arch/powerpc/kernel/process.c | 69 +++---
arch/powerpc/kernel/setup.h | 2 +-
arch/powerpc/kernel/setup_32.c | 17 +-
arch/powerpc/kernel/setup_64.c | 2 +-
arch/powerpc/kernel/traps.c | 9 +
arch/powerpc/kernel/vdso.c | 5 -
arch/powerpc/kernel/vdso32/Makefile | 4 +-
arch/powerpc/kernel/vdso32/cacheflush.S | 32 ++-
arch/powerpc/kernel/vdso32/datapage.S | 31 +--
arch/powerpc/kernel/vdso32/getcpu.S | 23 +-
arch/powerpc/kernel/vdso32/gettimeofday.S | 119 +++++++---
arch/powerpc/kernel/vdso32/vdso32.lds.S | 2 +-
arch/powerpc/kernel/vector.S | 3 +
arch/powerpc/kernel/vmlinux.lds.S | 2 +-
arch/powerpc/kvm/book3s_64_mmu_radix.c | 6 +-
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +
arch/powerpc/kvm/book3s_xive.c | 2 +-
arch/powerpc/mm/book3s32/hash_low.S | 46 ++--
arch/powerpc/mm/book3s32/mmu.c | 9 +-
arch/powerpc/mm/book3s64/hash_utils.c | 11 +-
arch/powerpc/mm/book3s64/radix_pgtable.c | 6 +-
arch/powerpc/mm/book3s64/radix_tlb.c | 3 +
arch/powerpc/mm/fault.c | 11 +-
arch/powerpc/mm/kasan/kasan_init_32.c | 89 ++++---
arch/powerpc/mm/mem.c | 4 +
arch/powerpc/mm/mmu_decl.h | 6 +
arch/powerpc/mm/nohash/8xx.c | 13 +-
arch/powerpc/mm/pgtable_32.c | 1 +
arch/powerpc/mm/ptdump/ptdump.c | 6 +-
arch/powerpc/oprofile/backtrace.c | 14 +-
arch/powerpc/perf/8xx-pmu.c | 12 +-
arch/powerpc/perf/callchain.c | 20 +-
arch/powerpc/perf/core-book3s.c | 8 +-
arch/powerpc/platforms/512x/mpc512x_lpbfifo.c | 6 +-
arch/powerpc/platforms/83xx/km83xx.c | 2 +-
arch/powerpc/platforms/85xx/smp.c | 9 +
arch/powerpc/platforms/85xx/twr_p102x.c | 5 +-
arch/powerpc/platforms/Kconfig | 4 +
arch/powerpc/platforms/Kconfig.cputype | 8 +
arch/powerpc/platforms/maple/setup.c | 2 +-
arch/powerpc/platforms/powernv/opal.c | 144 +++++------
arch/powerpc/platforms/powernv/pci-ioda.c | 244 ++++++++++++++-----
arch/powerpc/platforms/powernv/pci.c | 71 ++----
arch/powerpc/platforms/powernv/pci.h | 3 -
arch/powerpc/platforms/powernv/setup.c | 4 +
arch/powerpc/platforms/pseries/Kconfig | 1 -
arch/powerpc/platforms/pseries/firmware.c | 10 +-
arch/powerpc/platforms/pseries/hotplug-memory.c | 4 +-
arch/powerpc/platforms/pseries/iommu.c | 64 ++---
arch/powerpc/platforms/pseries/lparcfg.c | 4 +-
arch/powerpc/platforms/pseries/papr_scm.c | 8 +-
arch/powerpc/platforms/pseries/pci.c | 4 +-
arch/powerpc/platforms/pseries/vio.c | 2 +
arch/powerpc/sysdev/fsl_pci.c | 10 +-
arch/powerpc/sysdev/mpic.c | 4 +-
arch/powerpc/tools/relocs_check.sh | 20 +-
arch/powerpc/xmon/dis-asm.h | 4 +-
arch/powerpc/xmon/xmon.c | 20 +-
drivers/macintosh/Kconfig | 6 +-
drivers/misc/ocxl/Kconfig | 1 +
drivers/pci/hotplug/pnv_php.c | 82 ++++---
tools/testing/selftests/powerpc/eeh/eeh-functions.sh | 10 +-
tools/testing/selftests/powerpc/mm/.gitignore | 1 +
tools/testing/selftests/powerpc/mm/Makefile | 3 +-
tools/testing/selftests/powerpc/mm/bad_accesses.c | 171 +++++++++++++
tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c | 5 +-
141 files changed, 2310 insertions(+), 1121 deletions(-)
create mode 100644 Documentation/powerpc/imc.rst
create mode 100644 Documentation/powerpc/papr_hcalls.rst
delete mode 100644 arch/powerpc/kernel/idle_power4.S
create mode 100644 tools/testing/selftests/powerpc/mm/bad_accesses.c
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAl45XtUACgkQUevqPMjh
pYCBsxAAmof6budLg515kNyZTrl8TLVdZ3hFD8H7mHAufrK73z6n0fn0O+8n80lt
zILgL6J4VVCxgwjRsdhSaWOL58CTxqESj8D4MO7BbVr+epDOXPkvFs3Jc7CfdJWS
cHLaS/FO7Ou3LSOVf73OjKQszLYsz+mIgx+LVeVi8wxfNf+5WRhsnehORn/DylYN
t6TUPA9X1YmIpOuCLBw9g70xP211+OA+zqj5QSxhQQ/9p3IJw2mKQP5A+gCJVw6C
x8V/l0srAvdtegggzISH395QD8+pLg4MYpU9TCS/mdW3R9zCqD14qZgOGVLY6WFw
Mpi/UKqbGzvQcNl94BQEoXHjxV0/NwBtEiAhi1I1/zN42Z1NA2YhSTcu+pa9Ekgr
mrMl4ijSznmaKzaV9vt3khZpJYZUEQB8r89EIZbKmDD2zJVOrHSG/WPprTwf6meH
8ubke/Y6k1nf1rfEII5G9xFd2RJD2XIkJbVgqpXY3CZOZ8sMT5hzDfvOQiaVN2Oj
Kc7z6fTlIM6dB2lvYMltIk5uum4YHCTYDHpTGdfk5cZNi2V5QaXNZ6xcMRbIWTIQ
EXap44qqg9YPPQmJwzfZaxZ/Vo7ze0BS6iMdcv/UZFOOfe211IsFG7YHnVvryjiU
eG/f5LhaeIpfV+UMsJX048iLYTBzUm8CLQUam0fny+/sqBeThy0=
=5fUM
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH v4 2/7] powerpc/32s: Fix bad_kuap_fault()
From: Michael Ellerman @ 2020-02-04 12:03 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linux-mm, linuxppc-dev, linux-kernel
In-Reply-To: <f48244e9485ada0a304ed33ccbb8da271180c80d.1579866752.git.christophe.leroy@c-s.fr>
On Fri, 2020-01-24 at 11:54:40 UTC, Christophe Leroy wrote:
> At the moment, bad_kuap_fault() reports a fault only if a bad access
> to userspace occurred while access to userspace was not granted.
>
> But if a fault occurs for a write outside the allowed userspace
> segment(s) that have been unlocked, bad_kuap_fault() fails to
> detect it and the kernel loops forever in do_page_fault().
>
> Fix it by checking that the accessed address is within the allowed
> range.
>
> Fixes: a68c31fc01ef ("powerpc/32s: Implement Kernel Userspace Access Protection")
> Cc: stable@vger.kernel.org # v5.2+
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Link: https://lore.kernel.org/r/1e07c7de4ffdd9cda35d1ffe8258af75579d3e91.1579715466.git.christophe.leroy@c-s.fr
Patches 2-7 applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/6ec20aa2e510b6297906c45f009aa08b2d97269a
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: configs: Cleanup old Kconfig options
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Krzysztof Kozlowski, Benjamin Herrenschmidt, Paul Mackerras,
Geert Uytterhoeven, linuxppc-dev, linux-kernel
Cc: Krzysztof Kozlowski
In-Reply-To: <20200130195223.3843-1-krzk@kernel.org>
On Thu, 2020-01-30 at 19:52:23 UTC, Krzysztof Kozlowski wrote:
> CONFIG_ENABLE_WARN_DEPRECATED is gone since
> commit 771c035372a0 ("deprecate the '__deprecated' attribute warnings
> entirely and for good").
>
> CONFIG_IOSCHED_DEADLINE and CONFIG_IOSCHED_CFQ are gone since
> commit f382fb0bcef4 ("block: remove legacy IO schedulers").
>
> The IOSCHED_DEADLINE was replaced by MQ_IOSCHED_DEADLINE and it will be
> now enabled by default (along with MQ_IOSCHED_KYBER).
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/34b5a946a9543ce38d8ad1aacc4362533a813db7
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/32s: Fix kasan_early_hash_table() for CONFIG_VMAP_STACK
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <fc8390a33c2a470105f01abbcbdc7916c30c0a54.1580301269.git.christophe.leroy@c-s.fr>
On Wed, 2020-01-29 at 12:34:36 UTC, Christophe Leroy wrote:
> On book3s/32 CPUs that are handling MMU through a hash table,
> MMU_init_hw() function was adapted for VMAP_STACK in order to
> handle virtual addresses instead of physical addresses in the
> low level hash functions.
>
> When using KASAN, the same adaptations are required for the
> early hash table set up by kasan_early_hash_table() function.
>
> Fixes: cd08f109e262 ("powerpc/32s: Enable CONFIG_VMAP_STACK")
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/41196224883a64e56e0ef237c19eb837058df071
cheers
^ permalink raw reply
* Re: [PATCH RESEND] powerpc: indent to improve Kconfig readability
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Randy Dunlap, PowerPC; +Cc: Paul Mackerras
In-Reply-To: <ff8729c1-3a4b-c720-48ba-a1a42b0ef892@infradead.org>
On Wed, 2020-01-29 at 02:22:25 UTC, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Indent a Kconfig continuation line to improve readability.
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/76be4414be4a0d17e29e2337167bf976533149cd
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/32s: Fix CPU wake-up from sleep mode
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <6d02c3ae6ad77af34392e98117e44c2bf6d13ba1.1580121710.git.christophe.leroy@c-s.fr>
On Mon, 2020-01-27 at 10:42:04 UTC, Christophe Leroy wrote:
> Commit f7354ccac844 ("powerpc/32: Remove CURRENT_THREAD_INFO and
> rename TI_CPU") broke the CPU wake-up from sleep mode (i.e. when
> _TLF_SLEEPING is set) by delaying the tovirt(r2, r2).
>
> This is because r2 is not restored by fast_exception_return. It used
> to work (by chance ?) because CPU wake-up interrupt never comes from
> user, so r2 is expected to point to 'current' on return.
>
> Commit e2fb9f544431 ("powerpc/32: Prepare for Kernel Userspace Access
> Protection") broke it even more by clobbering r0 which is not
> restored by fast_exception_return either.
>
> Use r6 instead of r0. This is possible because r3-r6 are restored by
> fast_exception_return and only r3-r5 are used for exception arguments.
>
> For r2 it could be converted back to virtual address, but stay on the
> safe side and restore it from the stack instead. It should be live
> in the cache at that moment, so loading from the stack should make
> no difference compared to converting it from phys to virt.
>
> Fixes: f7354ccac844 ("powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU")
> Fixes: e2fb9f544431 ("powerpc/32: Prepare for Kernel Userspace Access Protection")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/9933819099c4600b41a042f27a074470a43cf6b9
cheers
^ permalink raw reply
* Re: [PATCH v2 01/10] powerpc/configs: Drop CONFIG_QLGE which moved to staging
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: oohall, joel, dja
In-Reply-To: <20200121043000.16212-1-mpe@ellerman.id.au>
On Tue, 2020-01-21 at 04:29:51 UTC, Michael Ellerman wrote:
> The QLGE driver moved to staging in commit 955315b0dc8c ("qlge: Move
> drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/"), meaning
> our defconfigs that enable it have no effect as we don't enable
> CONFIG_STAGING.
>
> It sounds like the device is obsolete, so drop the driver.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Patches 1-9 applied to powerpc next.
https://git.kernel.org/powerpc/c/76e4bd93369b87d97c2b1bcd6e754a89f422235b
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc: Do not consider weak unresolved symbol relocations as bad
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Alexandre Ghiti, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev, linux-kernel, Stephen Rothwell, Alexei Starovoitov,
linux-next, Zong Li, Palmer Dabbelt
Cc: Alexandre Ghiti
In-Reply-To: <20200118170335.21440-1-alex@ghiti.fr>
On Sat, 2020-01-18 at 17:03:35 UTC, Alexandre Ghiti wrote:
> Commit 8580ac9404f6 ("bpf: Process in-kernel BTF") introduced two weak
> symbols that may be unresolved at link time which result in an absolute
> relocation to 0. relocs_check.sh emits the following warning:
>
> "WARNING: 2 bad relocations
> c000000001a41478 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_start
> c000000001a41480 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_end"
>
> whereas those relocations are legitimate even for a relocatable kernel
> compiled with -pie option.
>
> relocs_check.sh already excluded some weak unresolved symbols explicitly:
> remove those hardcoded symbols and add some logic that parses the symbols
> using nm, retrieves all the weak unresolved symbols and excludes those from
> the list of the potential bad relocations.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/43e76cd368fbb67e767da5363ffeaa3989993c8c
cheers
^ permalink raw reply
* Re: [DOC][PATCH v2] powerpc: Provide initial documentation for PAPR hcalls
From: Michael Ellerman @ 2020-02-04 12:01 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev
Cc: msuchanek, Aneesh Kumar K . V, Nicholas Piggin,
Oliver O'Halloran, Vaibhav Jain, Laurent Dufour, David Gibson
In-Reply-To: <20190828082729.16695-1-vaibhav@linux.ibm.com>
On Wed, 2019-08-28 at 08:27:29 UTC, Vaibhav Jain wrote:
> This doc patch provides an initial description of the hcall op-codes
> that are used by Linux kernel running as a guest (LPAR) on top of
> PowerVM or any other sPAPR compliant hyper-visor (e.g qemu).
>
> Apart from documenting the hcalls the doc-patch also provides a
> rudimentary overview of how hcall ABI, how they are issued with the
> Linux kernel and how information/control flows between the guest and
> hypervisor.
>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/58b278f568f0509497e2df7310bfd719156a60d1
cheers
^ permalink raw reply
* Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory
From: Oscar Salvador @ 2020-02-04 9:51 UTC (permalink / raw)
To: David Hildenbrand
Cc: Mark Rutland, Pankaj Gupta, Michal Hocko, linux-ia64, linux-sh,
Peter Zijlstra, Catalin Marinas, Dave Hansen, Heiko Carstens,
Wei Yang, linux-mm, Pavel Tatashin, Rich Felker,
Alexander Potapenko, H. Peter Anvin, Alexander Duyck, Ira Weiny,
Thomas Gleixner, Qian Cai, linux-s390, Yu Zhao, Yoshinori Sato,
Jason Gunthorpe, Aneesh Kumar K . V, x86, Matthew Wilcox (Oracle),
Mike Rapoport, Halil Pasic, Christian Borntraeger, Ingo Molnar,
Gerald Schaefer, Wei Yang, Fenghua Yu, Pavel Tatashin,
Vasily Gorbik, Anshuman Khandual, Vlastimil Babka, Will Deacon,
Robin Murphy, Jun Yao, Borislav Petkov, Andy Lutomirski,
Dan Williams, linux-arm-kernel, Tony Luck, Mel Gorman,
Masahiro Yamada, Greg Kroah-Hartman, Steve Capper, linux-kernel,
Logan Gunthorpe, Tom Lendacky, Paul Mackerras, Andrew Morton,
linuxppc-dev
In-Reply-To: <78545b80-ea30-0d44-acb8-364312ae9595@redhat.com>
On Tue, Feb 04, 2020 at 09:45:24AM +0100, David Hildenbrand wrote:
> I really hope we'll find more reviewers in general - I'm also not happy
> if my patches go upstream with little/no review. However, patches
> shouldn't be stuck for multiple merge windows in linux-next IMHO
> (excluding exceptions of course) - then they should either be sent
> upstream (and eventually fixed later) or dropped.
First of all sorry for my lack of review, as lately I have been a bit disconnected
of the list because lack of time.
Lucky my I managed to find some time, so I went through the patches that did
lack review (#6-#10).
I hope this helps in moving forward the series, although Michal's review would be
great as well.
--
Oscar Salvador
SUSE L3
^ permalink raw reply
* Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()
From: Oscar Salvador @ 2020-02-04 9:46 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20191006085646.5768-11-david@redhat.com>
On Sun, Oct 06, 2019 at 10:56:46AM +0200, David Hildenbrand wrote:
> Let's drop the basically unused section stuff and simplify.
>
> Also, let's use a shorter variant to calculate the number of pages to
> the next section boundary.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Wei Yang <richardw.yang@linux.intel.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
I have to confess that it took me while to wrap around my head
with the new min() change, but looks ok:
Reviewed-by: Oscar Salvador <osalvador@suse.de>
> ---
> mm/memory_hotplug.c | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 843481bd507d..2275240cfa10 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -490,25 +490,20 @@ static void __remove_section(unsigned long pfn, unsigned long nr_pages,
> void __remove_pages(unsigned long pfn, unsigned long nr_pages,
> struct vmem_altmap *altmap)
> {
> + const unsigned long end_pfn = pfn + nr_pages;
> + unsigned long cur_nr_pages;
> unsigned long map_offset = 0;
> - unsigned long nr, start_sec, end_sec;
>
> map_offset = vmem_altmap_offset(altmap);
>
> if (check_pfn_span(pfn, nr_pages, "remove"))
> return;
>
> - start_sec = pfn_to_section_nr(pfn);
> - end_sec = pfn_to_section_nr(pfn + nr_pages - 1);
> - for (nr = start_sec; nr <= end_sec; nr++) {
> - unsigned long pfns;
> -
> + for (; pfn < end_pfn; pfn += cur_nr_pages) {
> cond_resched();
> - pfns = min(nr_pages, PAGES_PER_SECTION
> - - (pfn & ~PAGE_SECTION_MASK));
> - __remove_section(pfn, pfns, map_offset, altmap);
> - pfn += pfns;
> - nr_pages -= pfns;
> + /* Select all remaining pages up to the next section boundary */
> + cur_nr_pages = min(end_pfn - pfn, -(pfn | PAGE_SECTION_MASK));
> + __remove_section(pfn, cur_nr_pages, map_offset, altmap);
> map_offset = 0;
> }
> }
> --
> 2.21.0
>
>
--
Oscar Salvador
SUSE L3
^ permalink raw reply
* Re: [PATCH v6 09/10] mm/memory_hotplug: Drop local variables in shrink_zone_span()
From: David Hildenbrand @ 2020-02-04 9:29 UTC (permalink / raw)
To: Oscar Salvador
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20200204092623.GD6494@linux>
On 04.02.20 10:26, Oscar Salvador wrote:
> On Sun, Oct 06, 2019 at 10:56:45AM +0200, David Hildenbrand wrote:
>> Get rid of the unnecessary local variables.
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Oscar Salvador <osalvador@suse.de>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: Wei Yang <richardw.yang@linux.intel.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>> mm/memory_hotplug.c | 15 ++++++---------
>> 1 file changed, 6 insertions(+), 9 deletions(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 8dafa1ba8d9f..843481bd507d 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -374,14 +374,11 @@ static unsigned long find_biggest_section_pfn(int nid, struct zone *zone,
>> static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
>> unsigned long end_pfn)
>> {
>> - unsigned long zone_start_pfn = zone->zone_start_pfn;
>> - unsigned long z = zone_end_pfn(zone); /* zone_end_pfn namespace clash */
>> - unsigned long zone_end_pfn = z;
>> unsigned long pfn;
>> int nid = zone_to_nid(zone);
>
> We could also remove the nid, right?
> AFAICS, the nid is only used in find_{smallest/biggest}_section_pfn so we could
> place there as well.
I remember sending a patch on this (which was acked, but not picked up
yet)...
oh, there it is :)
https://lore.kernel.org/linux-mm/20191127174158.28226-1-david@redhat.com/
Thanks!
--
Thanks,
David / dhildenb
^ permalink raw reply
* Re: [PATCH v6 09/10] mm/memory_hotplug: Drop local variables in shrink_zone_span()
From: Oscar Salvador @ 2020-02-04 9:26 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20191006085646.5768-10-david@redhat.com>
On Sun, Oct 06, 2019 at 10:56:45AM +0200, David Hildenbrand wrote:
> Get rid of the unnecessary local variables.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Wei Yang <richardw.yang@linux.intel.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> mm/memory_hotplug.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 8dafa1ba8d9f..843481bd507d 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -374,14 +374,11 @@ static unsigned long find_biggest_section_pfn(int nid, struct zone *zone,
> static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
> unsigned long end_pfn)
> {
> - unsigned long zone_start_pfn = zone->zone_start_pfn;
> - unsigned long z = zone_end_pfn(zone); /* zone_end_pfn namespace clash */
> - unsigned long zone_end_pfn = z;
> unsigned long pfn;
> int nid = zone_to_nid(zone);
We could also remove the nid, right?
AFAICS, the nid is only used in find_{smallest/biggest}_section_pfn so we could
place there as well.
Anyway, nothing to nit-pick about:
Reviewed-by: Oscar Salvador <osalvador@suse.de>
>
> zone_span_writelock(zone);
> - if (zone_start_pfn == start_pfn) {
> + if (zone->zone_start_pfn == start_pfn) {
> /*
> * If the section is smallest section in the zone, it need
> * shrink zone->zone_start_pfn and zone->zone_spanned_pages.
> @@ -389,25 +386,25 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
> * for shrinking zone.
> */
> pfn = find_smallest_section_pfn(nid, zone, end_pfn,
> - zone_end_pfn);
> + zone_end_pfn(zone));
> if (pfn) {
> + zone->spanned_pages = zone_end_pfn(zone) - pfn;
> zone->zone_start_pfn = pfn;
> - zone->spanned_pages = zone_end_pfn - pfn;
> } else {
> zone->zone_start_pfn = 0;
> zone->spanned_pages = 0;
> }
> - } else if (zone_end_pfn == end_pfn) {
> + } else if (zone_end_pfn(zone) == end_pfn) {
> /*
> * If the section is biggest section in the zone, it need
> * shrink zone->spanned_pages.
> * In this case, we find second biggest valid mem_section for
> * shrinking zone.
> */
> - pfn = find_biggest_section_pfn(nid, zone, zone_start_pfn,
> + pfn = find_biggest_section_pfn(nid, zone, zone->zone_start_pfn,
> start_pfn);
> if (pfn)
> - zone->spanned_pages = pfn - zone_start_pfn + 1;
> + zone->spanned_pages = pfn - zone->zone_start_pfn + 1;
> else {
> zone->zone_start_pfn = 0;
> zone->spanned_pages = 0;
> --
> 2.21.0
>
--
Oscar Salvador
SUSE L3
^ permalink raw reply
* Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()
From: David Hildenbrand @ 2020-02-04 9:20 UTC (permalink / raw)
To: Oscar Salvador
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20200204091312.GC6494@linux>
On 04.02.20 10:13, Oscar Salvador wrote:
> On Sun, Oct 06, 2019 at 10:56:44AM +0200, David Hildenbrand wrote:
>> If we have holes, the holes will automatically get detected and removed
>> once we remove the next bigger/smaller section. The extra checks can
>> go.
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Oscar Salvador <osalvador@suse.de>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: Wei Yang <richardw.yang@linux.intel.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>
> Heh, I have been here before.
> I have to confess that when I wrote my version of this I was not really 100%
> about removing it, because hotplug was a sort of a "catchall" for all sort of weird
> and corner-cases configurations, but thinking more about it, I cannot think of
> any situation that would make this blow up.
>
> Reviewed-by: Oscar Salvador <osalvador@suse.de>
Thanks for your review Oscar!
--
Thanks,
David / dhildenb
^ permalink raw reply
* Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()
From: Oscar Salvador @ 2020-02-04 9:13 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20191006085646.5768-9-david@redhat.com>
On Sun, Oct 06, 2019 at 10:56:44AM +0200, David Hildenbrand wrote:
> If we have holes, the holes will automatically get detected and removed
> once we remove the next bigger/smaller section. The extra checks can
> go.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Wei Yang <richardw.yang@linux.intel.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
Heh, I have been here before.
I have to confess that when I wrote my version of this I was not really 100%
about removing it, because hotplug was a sort of a "catchall" for all sort of weird
and corner-cases configurations, but thinking more about it, I cannot think of
any situation that would make this blow up.
Reviewed-by: Oscar Salvador <osalvador@suse.de>
> ---
> mm/memory_hotplug.c | 34 +++++++---------------------------
> 1 file changed, 7 insertions(+), 27 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index f294918f7211..8dafa1ba8d9f 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -393,6 +393,9 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
> if (pfn) {
> zone->zone_start_pfn = pfn;
> zone->spanned_pages = zone_end_pfn - pfn;
> + } else {
> + zone->zone_start_pfn = 0;
> + zone->spanned_pages = 0;
> }
> } else if (zone_end_pfn == end_pfn) {
> /*
> @@ -405,34 +408,11 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
> start_pfn);
> if (pfn)
> zone->spanned_pages = pfn - zone_start_pfn + 1;
> + else {
> + zone->zone_start_pfn = 0;
> + zone->spanned_pages = 0;
> + }
> }
> -
> - /*
> - * The section is not biggest or smallest mem_section in the zone, it
> - * only creates a hole in the zone. So in this case, we need not
> - * change the zone. But perhaps, the zone has only hole data. Thus
> - * it check the zone has only hole or not.
> - */
> - pfn = zone_start_pfn;
> - for (; pfn < zone_end_pfn; pfn += PAGES_PER_SUBSECTION) {
> - if (unlikely(!pfn_to_online_page(pfn)))
> - continue;
> -
> - if (page_zone(pfn_to_page(pfn)) != zone)
> - continue;
> -
> - /* Skip range to be removed */
> - if (pfn >= start_pfn && pfn < end_pfn)
> - continue;
> -
> - /* If we find valid section, we have nothing to do */
> - zone_span_writeunlock(zone);
> - return;
> - }
> -
> - /* The zone has no valid section */
> - zone->zone_start_pfn = 0;
> - zone->spanned_pages = 0;
> zone_span_writeunlock(zone);
> }
>
> --
> 2.21.0
>
--
Oscar Salvador
SUSE L3
^ permalink raw reply
* Re: [PATCH 0/3] pseries: Track and expose idle PURR and SPURR ticks
From: Kamalesh Babulal @ 2020-02-04 9:12 UTC (permalink / raw)
To: Naveen N. Rao, Nathan Lynch
Cc: Tyrel Datwyler, Gautham R. Shenoy, linux-kernel,
Vaidyanathan Srinivasan, linuxppc-dev
In-Reply-To: <1575623305.dgcux6u43j.naveen@linux.ibm.com>
On 12/6/19 2:44 PM, Naveen N. Rao wrote:
> Naveen N. Rao wrote:
>> Hi Nathan,
>>
>> Nathan Lynch wrote:
>>> Hi Kamalesh,
>>>
>>> Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> writes:
>>>> On 12/5/19 3:54 AM, Nathan Lynch wrote:
>>>>> "Gautham R. Shenoy" <ego@linux.vnet.ibm.com> writes:
>>>>>>
>>>>>> Tools such as lparstat which are used to compute the utilization need
>>>>>> to know [S]PURR ticks when the cpu was busy or idle. The [S]PURR
>>>>>> counters are already exposed through sysfs. We already account for
>>>>>> PURR ticks when we go to idle so that we can update the VPA area. This
>>>>>> patchset extends support to account for SPURR ticks when idle, and
>>>>>> expose both via per-cpu sysfs files.
>>>>>
>>>>> Does anything really want to use PURR instead of SPURR? Seems like we
>>>>> should expose only SPURR idle values if possible.
>>>>>
>>>>
>>>> lparstat is one of the consumers of PURR idle metric
>>>> (https://groups.google.com/forum/#!topic/powerpc-utils-devel/fYRo69xO9r4). Agree, on the argument that system utilization metrics based on SPURR
>>>> accounting is accurate in comparison to PURR, which isn't proportional to
>>>> CPU frequency. PURR has been traditionally used to understand the system
>>>> utilization, whereas SPURR is used for understanding how much capacity is
>>>> left/exceeding in the system based on the current power saving mode.
>>>
>>> I'll phrase my question differently: does SPURR complement or supercede
>>> PURR? You seem to be saying they serve different purposes. If PURR is
>>> actually useful rather then vestigial then I have no objection to
>>> exposing idle_purr.
>>
>> SPURR complements PURR, so we need both. SPURR/PURR ratio helps provide an indication of the available headroom in terms of core resources, at maximum frequency.
>
> Re-reading this today morning, I realize that this isn't entirely accurate. SPURR alone is sufficient to understand core resource utilization.
>
> Kamalesh is using PURR to display non-normalized utilization values (under 'actual' column), as reported by lparstat on AIX. I am not entirely sure if it is ok to derive these based on the SPURR busy/idle ratio.
Both idle_purr and idle_spurr complement each other and we need to expose both of them.
It will improve the accounting accuracy of tools currently consuming system-wide PURR
and/or SPURR numbers to report system usage. Deriving one from another, from my
experience makes it hard for tools or any custom scripts to give an accurate system view.
One tool I am aware of is lparstat, which uses PURR based metrics.
--
Kamalesh
^ permalink raw reply
* Re: [PATCH v6 07/10] mm/memory_hotplug: We always have a zone in find_(smallest|biggest)_section_pfn
From: Oscar Salvador @ 2020-02-04 9:06 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Wei Yang, Andrew Morton,
linuxppc-dev, Dan Williams, linux-arm-kernel
In-Reply-To: <20191006085646.5768-8-david@redhat.com>
On Sun, Oct 06, 2019 at 10:56:43AM +0200, David Hildenbrand wrote:
> With shrink_pgdat_span() out of the way, we now always have a valid
> zone.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Wei Yang <richardw.yang@linux.intel.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
> ---
> mm/memory_hotplug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index bf5173e7913d..f294918f7211 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -337,7 +337,7 @@ static unsigned long find_smallest_section_pfn(int nid, struct zone *zone,
> if (unlikely(pfn_to_nid(start_pfn) != nid))
> continue;
>
> - if (zone && zone != page_zone(pfn_to_page(start_pfn)))
> + if (zone != page_zone(pfn_to_page(start_pfn)))
> continue;
>
> return start_pfn;
> @@ -362,7 +362,7 @@ static unsigned long find_biggest_section_pfn(int nid, struct zone *zone,
> if (unlikely(pfn_to_nid(pfn) != nid))
> continue;
>
> - if (zone && zone != page_zone(pfn_to_page(pfn)))
> + if (zone != page_zone(pfn_to_page(pfn)))
> continue;
>
> return pfn;
> --
> 2.21.0
>
--
Oscar Salvador
SUSE L3
^ permalink raw reply
* Re: [PATCH v6 06/10] mm/memory_hotplug: Poison memmap in remove_pfn_range_from_zone()
From: Oscar Salvador @ 2020-02-04 8:59 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-s390, Michal Hocko, linux-ia64, Pavel Tatashin, linux-sh,
x86, linux-kernel, linux-mm, Andrew Morton, linuxppc-dev,
Dan Williams, linux-arm-kernel
In-Reply-To: <20191006085646.5768-7-david@redhat.com>
On Sun, Oct 06, 2019 at 10:56:42AM +0200, David Hildenbrand wrote:
> Let's poison the pages similar to when adding new memory in
> sparse_add_section(). Also call remove_pfn_range_from_zone() from
> memunmap_pages(), so we can poison the memmap from there as well.
>
> While at it, calculate the pfn in memunmap_pages() only once.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
Looks good to me, it is fine as long as we do not access those pages later on,
and if my eyes did not lie to me, we have to proper checks (pfn_to_online_page)
in place to avoid that, so:
Reviewed-by: Oscar Salvador <osalvador@suse.de>
--
Oscar Salvador
SUSE L3
^ permalink raw reply
* Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory
From: David Hildenbrand @ 2020-02-04 8:45 UTC (permalink / raw)
To: Andrew Morton
Cc: Mark Rutland, Pankaj Gupta, Michal Hocko, linux-ia64, linux-sh,
Peter Zijlstra, Catalin Marinas, Dave Hansen, Heiko Carstens,
Wei Yang, linux-mm, Pavel Tatashin, Rich Felker,
Alexander Potapenko, H. Peter Anvin, Alexander Duyck, Ira Weiny,
Thomas Gleixner, Qian Cai, linux-s390, Yu Zhao, Yoshinori Sato,
Jason Gunthorpe, Aneesh Kumar K . V, x86, Matthew Wilcox (Oracle),
Mike Rapoport, Halil Pasic, Christian Borntraeger, Ingo Molnar,
Gerald Schaefer, Fenghua Yu, Pavel Tatashin, Vasily Gorbik,
Anshuman Khandual, Vlastimil Babka, Will Deacon, Robin Murphy,
Jun Yao, Borislav Petkov, Andy Lutomirski, Dan Williams,
linux-arm-kernel, Oscar Salvador, Tony Luck, Mel Gorman,
Masahiro Yamada, Greg Kroah-Hartman, Steve Capper, linux-kernel,
Logan Gunthorpe, Wei Yang, Paul Mackerras, Tom Lendacky,
linuxppc-dev
In-Reply-To: <20200203174653.74630ef5744c68be55374b0d@linux-foundation.org>
>> I can understand this is desirable (yet, I am
>> not sure if this makes sense with the current take-and-not-give-back
>> review mentality on this list).
>>
>> Although it will make upstreaming stuff *even harder* and *even slower*,
>> maybe we should start to only queue patches that have an ACK/RB, so they
>> won't get blocked by this later on? At least that makes your life easier
>> and people won't have to eventually follow up on patches that have been
>> in linux-next for months.
>
> The merge rate would still be the review rate, but the resulting merges
> would be of less tested code.
That's a valid point.
>
>> Note: the result will be that many of my patches will still not get
>> reviewed, won't get queued/upstreamed, I will continuously ping and
>> resend, I will lose interest because I have better things to do, I will
>> lose interest in our code quality, I will lose interest to review.
>>
>> (side note: some people might actually enjoy me sending less cleanup
>> patches, so this approach might be desirable for some ;) )
>>
>> One alternative is to send patches upstream once they have been lying
>> around in linux-next for $RANDOM number of months, because they
>> obviously saw some testing and nobody started to yell at them once
>> stumbling over them on linux-mm.
>
> Yes, I think that's the case with these patches and I've sent them to
> Linus. Hopefully Michel will be able to find time to look them over in
> the next month or so.
I really hope we'll find more reviewers in general - I'm also not happy
if my patches go upstream with little/no review. However, patches
shouldn't be stuck for multiple merge windows in linux-next IMHO
(excluding exceptions of course) - then they should either be sent
upstream (and eventually fixed later) or dropped.
Thanks Andrew!
--
Thanks,
David / dhildenb
^ permalink raw reply
* Re: [PATCH 2/3] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU
From: Naveen N. Rao @ 2020-02-04 7:52 UTC (permalink / raw)
To: ego
Cc: Nathan Lynch, Tyrel Datwyler, linux-kernel, Kamalesh Babulal,
Vaidyanathan Srinivasan, linuxppc-dev
In-Reply-To: <20200203045013.GC13468@in.ibm.com>
Gautham R Shenoy wrote:
> Hi Naveen,
>
> On Thu, Dec 05, 2019 at 10:23:58PM +0530, Naveen N. Rao wrote:
>> >diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
>> >index 80a676d..42ade55 100644
>> >--- a/arch/powerpc/kernel/sysfs.c
>> >+++ b/arch/powerpc/kernel/sysfs.c
>> >@@ -1044,6 +1044,36 @@ static ssize_t show_physical_id(struct device *dev,
>> > }
>> > static DEVICE_ATTR(physical_id, 0444, show_physical_id, NULL);
>> >
>> >+static ssize_t idle_purr_show(struct device *dev,
>> >+ struct device_attribute *attr, char *buf)
>> >+{
>> >+ struct cpu *cpu = container_of(dev, struct cpu, dev);
>> >+ unsigned int cpuid = cpu->dev.id;
>> >+ struct lppaca *cpu_lppaca_ptr = paca_ptrs[cpuid]->lppaca_ptr;
>> >+ u64 idle_purr_cycles = be64_to_cpu(cpu_lppaca_ptr->wait_state_cycles);
>> >+
>> >+ return sprintf(buf, "%llx\n", idle_purr_cycles);
>> >+}
>> >+static DEVICE_ATTR_RO(idle_purr);
>> >+
>> >+DECLARE_PER_CPU(u64, idle_spurr_cycles);
>> >+static ssize_t idle_spurr_show(struct device *dev,
>> >+ struct device_attribute *attr, char *buf)
>> >+{
>> >+ struct cpu *cpu = container_of(dev, struct cpu, dev);
>> >+ unsigned int cpuid = cpu->dev.id;
>> >+ u64 *idle_spurr_cycles_ptr = per_cpu_ptr(&idle_spurr_cycles, cpuid);
>>
>> Is it possible for a user to read stale values if a particular cpu is in an
>> extended cede? Is it possible to use smp_call_function_single() to force the
>> cpu out of idle?
>
> Yes, if the CPU whose idle_spurr cycle is being read is still in idle,
> then we will miss reporting the delta spurr cycles for this last
> idle-duration. Yes, we can use an smp_call_function_single(), though
> that will introduce IPI noise. How often will idle_[s]purr be read ?
Since it is possible for a cpu to go into extended cede for multiple
seconds during which time it is possible to mis-report utilization, I
think it is better to ensure that the sysfs interface for idle_[s]purr
report the proper values through use of IPI.
With repect to lparstat, the read interval is user-specified and just
gets passed onto sleep().
- Naveen
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox