[PATCH rcu 03/15] rcutorture: Make rcutorture_one_extend_check() account for hard IRQs

2025-07-09 Thread neeraj . upadhyay
From: "Paul E. McKenney" This commit retrospectively prepares for testing of RCU readers invoked from hardware interrupt handlers (for example, HRTIMER_MODE_HARD hrtimer handlers) in kernels built with CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE=y, which is rarely used but sometimes extremely useful.

[PATCH net-next v4 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-18 Thread Breno Leitao
Add a call to dev_dstats_rx_dropped_add() in nsim_queue_free() to account for the number of packets dropped when purging the skb queue. This improves the accuracy of RX drop statistics reported by netdevsim. local_bh_{disable, enable}() protection is used to disable preemption, which is necessary

Re: [PATCH net-next v3 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-17 Thread Jakub Kicinski
On Tue, 17 Jun 2025 06:24:23 -0700 Breno Leitao wrote: > > here we are in process context and debug checks complain about the use > > of this_cpu_ptr(). Let's wrap this in local_bh_disable() / enable() ? > > Thanks. I was able to reproduce it. Your suggestion avoids the complain. > I suppose we

Re: [PATCH net-next v3 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-17 Thread Breno Leitao
On Tue, Jun 17, 2025 at 05:59:34AM -0700, Jakub Kicinski wrote: > On Tue, 17 Jun 2025 01:19:00 -0700 Breno Leitao wrote: > > -static void nsim_queue_free(struct nsim_rq *rq) > > +static void nsim_queue_free(struct net_device *dev, struct nsim_rq *rq) > > { > > hrtimer_cancel(&rq->napi_timer);

Re: [PATCH net-next v3 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-17 Thread Jakub Kicinski
On Tue, 17 Jun 2025 01:19:00 -0700 Breno Leitao wrote: > -static void nsim_queue_free(struct nsim_rq *rq) > +static void nsim_queue_free(struct net_device *dev, struct nsim_rq *rq) > { > hrtimer_cancel(&rq->napi_timer); > + dev_dstats_rx_dropped_add(dev, rq->skb_queue.qlen); here we are

[PATCH net-next v3 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-17 Thread Breno Leitao
Add a call to dev_dstats_rx_dropped_add() in nsim_queue_free() to account for the number of packets dropped when purging the skb queue. This improves the accuracy of RX drop statistics reported by netdevsim. Suggested-by: Jakub Kicinski Signed-off-by: Breno Leitao --- drivers/net/netdevsim

Re: [PATCH net-next v2 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-13 Thread Breno Leitao
On Fri, Jun 13, 2025 at 07:55:07AM -0700, Jakub Kicinski wrote: > On Fri, 13 Jun 2025 07:47:11 -0700 Breno Leitao wrote: > > > static void nsim_queue_free(struct nsim_rq *rq) > > > { > > > + struct net_device *dev = rq->napi.dev; > > > + > > > hrtimer_cancel(&rq->napi_timer); > > > + dev_dstats

Re: [PATCH net-next v2 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-13 Thread Jakub Kicinski
On Fri, 13 Jun 2025 07:47:11 -0700 Breno Leitao wrote: > > static void nsim_queue_free(struct nsim_rq *rq) > > { > > + struct net_device *dev = rq->napi.dev; > > + > > hrtimer_cancel(&rq->napi_timer); > > + dev_dstats_rx_dropped_add(dev, rq->skb_queue.qlen); > > This is wrong and it wi

Re: [PATCH net-next v2 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-13 Thread Breno Leitao
On Fri, Jun 13, 2025 at 03:40:01AM -0700, Breno Leitao wrote: > Add a call to dev_dstats_rx_dropped_add() in nsim_queue_free() to > account for the number of packets dropped when purging the skb queue. > > This improves the accuracy of RX drop statistics reported by > netdevsim. &g

[PATCH net-next v2 4/4] netdevsim: account dropped packet length in stats on queue free

2025-06-13 Thread Breno Leitao
Add a call to dev_dstats_rx_dropped_add() in nsim_queue_free() to account for the number of packets dropped when purging the skb queue. This improves the accuracy of RX drop statistics reported by netdevsim. Suggested-by: Jakub Kicinski Signed-off-by: Breno Leitao --- drivers/net/netdevsim

Re: [PATCH v3 4/5] module: Account for the build time module name mangling

2025-05-14 Thread Petr Pavlu
On 5/2/25 16:12, Peter Zijlstra wrote: > Sean noted that scripts/Makefile.lib:name-fix-token rule will mangle > the module name with s/-/_/g. > > Since this happens late in the build, only the kernel needs to bother > with this, the modpost tool still sees the original name. > > Reported-by: Sean

[PATCH v3 4/5] module: Account for the build time module name mangling

2025-05-02 Thread Peter Zijlstra
Sean noted that scripts/Makefile.lib:name-fix-token rule will mangle the module name with s/-/_/g. Since this happens late in the build, only the kernel needs to bother with this, the modpost tool still sees the original name. Reported-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel

Re: [PATCH -v2 6/7] module: Account for the build time module name mangling

2025-05-02 Thread Peter Zijlstra
On Mon, Dec 02, 2024 at 03:59:52PM +0100, Peter Zijlstra wrote: > Sean noted that scripts/Makefile.lib:name-fix-token rule will mangle > the module name with s/-/_/g. > > Since this happens late in the build, only the kernel needs to bother > with this, the modpost tool still sees the original nam

Re: [PATCH v3 05/57] KVM: x86: Account for KVM-reserved CR4 bits when passing through CR4 on VMX

2024-12-12 Thread Chao Gao
On Wed, Nov 27, 2024 at 05:33:32PM -0800, Sean Christopherson wrote: >Drop x86.c's local pre-computed cr4_reserved bits and instead fold KVM's >reserved bits into the guest's reserved bits. This fixes a bug where VMX's >set_cr4_guest_host_mask() fails to accou

Re: [PATCH -v2 6/7] module: Account for the build time module name mangling

2024-12-06 Thread Sean Christopherson
On Mon, Dec 02, 2024, Peter Zijlstra wrote: > Sean noted that scripts/Makefile.lib:name-fix-token rule will mangle > the module name with s/-/_/g. > > Since this happens late in the build, only the kernel needs to bother > with this, the modpost tool still sees the original name. > > Reported-by:

[PATCH -v2 6/7] module: Account for the build time module name mangling

2024-12-02 Thread Peter Zijlstra
Sean noted that scripts/Makefile.lib:name-fix-token rule will mangle the module name with s/-/_/g. Since this happens late in the build, only the kernel needs to bother with this, the modpost tool still sees the original name. Reported-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel

[PATCH v3 21/57] KVM: x86: Account for max supported CPUID leaf when getting raw host CPUID

2024-11-27 Thread Sean Christopherson
Explicitly zero out the feature word in kvm_cpu_caps if the word's associated CPUID function is greater than the max leaf supported by the CPU. For such unsupported functions, Intel CPUs return the output from the last supported leaf, not all zeros. Practically speaking, this is likely a benign b

[PATCH v3 05/57] KVM: x86: Account for KVM-reserved CR4 bits when passing through CR4 on VMX

2024-11-27 Thread Sean Christopherson
Drop x86.c's local pre-computed cr4_reserved bits and instead fold KVM's reserved bits into the guest's reserved bits. This fixes a bug where VMX's set_cr4_guest_host_mask() fails to account for KVM-reserved bits when deciding which bits can be passed through to the guest. In

[RFC PATCH v4 01/17] powerpc/trace: Account for -fpatchable-function-entry support by toolchain

2024-07-14 Thread Naveen N Rao
So far, we have relied on the fact that gcc supports both -mprofile-kernel, as well as -fpatchable-function-entry, and clang supports neither. Our Makefile only checks for CONFIG_MPROFILE_KERNEL to decide which files to build. Clang has a feature request out [*] to implement -fpatchable-function-en

Re: [RFC PATCH 2/7] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

2024-04-14 Thread Mike Rapoport
w bpf_prog_pack, while it could do with PMD_SIZE'ed packs. > > > > Don't account for number of nodes for VM_ALLOW_HUGE_VMAP with > > NUMA_NO_NODE and use huge pages whenever the requested allocation size > > is larger than PMD_SIZE. > > Patch looks ok but messag

Re: [RFC PATCH 2/7] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

2024-04-11 Thread Christophe Leroy
ed memory is not distributed between nodes and > there is no advantage in such approach. > On the contrary, BPF allocates PMD_SIZE * num_possible_nodes() for each > new bpf_prog_pack, while it could do with PMD_SIZE'ed packs. > > Don't account for number of nodes for VM_A

[RFC PATCH 2/7] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

2024-04-11 Thread Mike Rapoport
ch. On the contrary, BPF allocates PMD_SIZE * num_possible_nodes() for each new bpf_prog_pack, while it could do with PMD_SIZE'ed packs. Don't account for number of nodes for VM_ALLOW_HUGE_VMAP with NUMA_NO_NODE and use huge pages whenever the requested allocation size is larger than PMD_

Re: [PATCH v2] vhost-vdpa: account iommu allocations

2023-12-26 Thread David Rientjes
On Tue, 26 Dec 2023, Pasha Tatashin wrote: > iommu allocations should be accounted in order to allow admins to > monitor and limit the amount of iommu memory. > > Signed-off-by: Pasha Tatashin > Acked-by: Michael S. Tsirkin Acked-by: David Rientjes

[PATCH v2] vhost-vdpa: account iommu allocations

2023-12-26 Thread Pasha Tatashin
iommu allocations should be accounted in order to allow admins to monitor and limit the amount of iommu memory. Signed-off-by: Pasha Tatashin Acked-by: Michael S. Tsirkin --- drivers/vhost/vdpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changelog: v1: This patch is spinned of f

[PATCH v2 2/5] sched: Take cpufreq feedback into account

2023-12-21 Thread Vincent Guittot
unsigned long cur_delta, base_energy; @@ -7962,18 +7971,17 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) if (cpumask_empty(cpus)) continue; - /* Account thermal pressure for the energy estimation

Re: [PATCH 2/4] sched: Take cpufreq feedback into account

2023-12-15 Thread Lukasz Luba
unsigned long rq_util_min, rq_util_max; unsigned long cur_delta, base_energy; @@ -7962,18 +7969,17 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) if (cpumask_empty(cpus)) continue; - /* Account ther

[PATCH 2/4] sched: Take cpufreq feedback into account

2023-12-12 Thread Vincent Guittot
ergy; @@ -7962,18 +7969,17 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) if (cpumask_empty(cpus)) continue; - /* Account thermal pressure for the energy estimation */ + /* Account external press

[PATCH] vhost-vdpa: account iommu allocations

2023-11-30 Thread Pasha Tatashin
iommu allocations should be accounted in order to allow admins to monitor and limit the amount of iommu memory. Signed-off-by: Pasha Tatashin --- drivers/vhost/vdpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) This patch is spinned of from the series: https://lore.kernel.org/all/20

Re: [PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-15 Thread Sean Christopherson
On Thu, Apr 15, 2021, Wanpeng Li wrote: > On Thu, 15 Apr 2021 at 08:49, Sean Christopherson wrote: > > > > On Wed, Apr 14, 2021, Wanpeng Li wrote: > > > On Wed, 14 Apr 2021 at 01:25, Sean Christopherson > > > wrote: > > > > > > > > On Tue, Apr 13, 2021, Wanpeng Li wrote: > > > > > The bugzilla h

Re: [PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-14 Thread Wanpeng Li
On Thu, 15 Apr 2021 at 08:49, Sean Christopherson wrote: > > On Wed, Apr 14, 2021, Wanpeng Li wrote: > > On Wed, 14 Apr 2021 at 01:25, Sean Christopherson wrote: > > > > > > On Tue, Apr 13, 2021, Wanpeng Li wrote: > > > > The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 > > > > rep

Re: [PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-14 Thread Sean Christopherson
On Wed, Apr 14, 2021, Wanpeng Li wrote: > On Wed, 14 Apr 2021 at 01:25, Sean Christopherson wrote: > > > > On Tue, Apr 13, 2021, Wanpeng Li wrote: > > > The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 > > > reported that the guest time remains 0 when running a while true > > > loop

Re: [PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-14 Thread Wanpeng Li
On Wed, 14 Apr 2021 at 01:25, Sean Christopherson wrote: > > On Tue, Apr 13, 2021, Wanpeng Li wrote: > > The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 > > reported that the guest time remains 0 when running a while true > > loop in the guest. > > > > The commit 87fa7f3e98a131 ("x

[v2 PATCH 4/7] mm: migrate: account THP NUMA migration counters correctly

2021-04-13 Thread Yang Shi
Now both base page and THP NUMA migration is done via migrate_misplaced_page(), keep the counters correctly for THP. Signed-off-by: Yang Shi --- mm/migrate.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 333448aa53f1..a473f25fbd01 10

Re: [PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-13 Thread Sean Christopherson
On Tue, Apr 13, 2021, Wanpeng Li wrote: > The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 > reported that the guest time remains 0 when running a while true > loop in the guest. > > The commit 87fa7f3e98a131 ("x86/kvm: Move context tracking where it > belongs") moves guest_exit_irq

Re: [PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-13 Thread Christian Borntraeger
On 13.04.21 09:16, Wanpeng Li wrote: The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 reported that the guest time remains 0 when running a while true loop in the guest. The commit 87fa7f3e98a131 ("x86/kvm: Move context tracking where it belongs") moves guest_exit_irqoff() clos

[PATCH v2 0/3] KVM: Properly account for guest CPU time

2021-04-13 Thread Wanpeng Li
The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 reported that the guest time remains 0 when running a while true loop in the guest. The commit 87fa7f3e98a131 ("x86/kvm: Move context tracking where it belongs") moves guest_exit_irqoff() close to vmexit breaks the tick-based time acc

[PATCH v7 04/28] mm/vmstat: Add functions to account folio statistics

2021-04-09 Thread Matthew Wilcox (Oracle)
Allow page counters to be more readily modified by callers which have a folio. Name these wrappers with 'stat' instead of 'state' as requested by Linus here: https://lore.kernel.org/linux-mm/CAHk-=wj847sudr-kt+46ft3+xffgiwpgthvm7djwgdi4cvr...@mail.gmail.com/ Signed-off-by: Matthew Wilcox (Oracle)

Re: [PATCH v1 0/5] cpuidle: Take possible negative "sleep length" values into account

2021-04-07 Thread Rafael J. Wysocki
as to avoid > mishandling negative "sleep length" values (patch [4/5]). > > Finally, make the menu governor take negative "sleep length" values into > account properly (patch [5/5]). > > Please see the changelogs of the patches for details. Given no objections or concerns regarding this lot, let me queue it up. Thanks!

Re: [PATCH] platform/x86: ISST: Account for increased timeout in some cases

2021-04-07 Thread Hans de Goede
Hi, On 3/31/21 12:08 AM, Srinivas Pandruvada wrote: > In some cases when firmware is busy or updating, some mailbox commands > still timeout on some newer CPUs. To fix this issue, change how we > process timeout. > > With this change, replaced timeout from using simple count with real > timeout i

Re: [PATCH] KVM: X86: Properly account for guest CPU time when considering context tracking

2021-04-06 Thread Sean Christopherson
On Tue, Mar 30, 2021, Wanpeng Li wrote: > On Tue, 30 Mar 2021 at 01:15, Sean Christopherson wrote: > > > > +Thomas > > > > On Mon, Mar 29, 2021, Wanpeng Li wrote: > > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > > > index 32cf828..85695b3 100644 > > > --- a/arch/x86/kvm/vmx/vmx

Re: [PATCH v6 03/27] mm/vmstat: Add functions to account folio statistics

2021-04-06 Thread Christoph Hellwig
On Wed, Mar 31, 2021 at 07:47:04PM +0100, Matthew Wilcox (Oracle) wrote: > Allow page counters to be more readily modified by callers which have > a folio. Name these wrappers with 'stat' instead of 'state' as requested > by Linus here: Looks good, Reviewed-by: Christoph Hellwig

[RFC PATCH v1 03/11] mm: Account the top tier memory usage per cgroup

2021-04-05 Thread Tim Chen
For each memory cgroup, account its usage of the top tier memory at the time a top tier page is assigned and uncharged from the cgroup. Signed-off-by: Tim Chen --- include/linux/memcontrol.h | 1 + mm/memcontrol.c| 39 +- 2 files changed, 39

[RFC PATCH v1 07/11] mm: Account the total top tier memory in use

2021-04-05 Thread Tim Chen
Track the global top tier memory usage stats. They are used as the basis of deciding when to start demoting pages from memory cgroups that have exceeded their soft limit. We start reclaiming top tier memory when the total top tier memory is low. Signed-off-by: Tim Chen --- include/linux/vmstat.

Re: [PATCH 5/6] clk: qcom: gcc-sdm660: Account for needed adjustments in probe function

2021-04-01 Thread Konrad Dybcio
+ + /* Keep bimc gfx clock port on all the time */ + clk_prepare_enable(gcc_bimc_gfx_clk.clkr.hw.clk); + >>> Preferably just set these various bits with regmap_update_bits() during >>> probe. Also, please do it before regsitering the clks, not after. >> To be fair,

Re: [PATCH 5/6] clk: qcom: gcc-sdm660: Account for needed adjustments in probe function

2021-03-31 Thread Stephen Boyd
Quoting Konrad Dybcio (2021-02-25 11:09:14) > Hi and sorry for the late reply, > I'm sorry too. This fell off my review queue for some time. > > >> + > >> + /* Keep bimc gfx clock port on all the time */ > >> + clk_prepare_enable(gcc_bimc_gfx_clk.clkr.hw.clk); > >> + > > Preferably

[PATCH v6 03/27] mm/vmstat: Add functions to account folio statistics

2021-03-31 Thread Matthew Wilcox (Oracle)
Allow page counters to be more readily modified by callers which have a folio. Name these wrappers with 'stat' instead of 'state' as requested by Linus here: https://lore.kernel.org/linux-mm/CAHk-=wj847sudr-kt+46ft3+xffgiwpgthvm7djwgdi4cvr...@mail.gmail.com/ Signed-off-by: Matthew Wilcox (Oracle)

Re: [PATCH 2/2] KVM: x86: Account a variety of miscellaneous allocations

2021-03-31 Thread Paolo Bonzini
On 31/03/21 04:30, Sean Christopherson wrote: Switch to GFP_KERNEL_ACCOUNT for a handful of allocations that are clearly associated with a single task/VM. Note, there are a several SEV allocations that aren't accounted, but those can (hopefully) be fixed by using the local stack for memory. Sig

Re: [PATCH 1/2] KVM: Account memory allocations for 'struct kvm_vcpu'

2021-03-30 Thread Wanpeng Li
On Wed, 31 Mar 2021 at 11:24, Sean Christopherson wrote: > > On Wed, Mar 31, 2021, Wanpeng Li wrote: > > On Wed, 31 Mar 2021 at 10:32, Sean Christopherson wrote: > > > > > > Use GFP_KERNEL_ACCOUNT for the vCPU allocations, the vCPUs are very much > > > tied to a single task/VM. For x86, the allo

Re: [PATCH 1/2] KVM: Account memory allocations for 'struct kvm_vcpu'

2021-03-30 Thread Sean Christopherson
On Wed, Mar 31, 2021, Wanpeng Li wrote: > On Wed, 31 Mar 2021 at 10:32, Sean Christopherson wrote: > > > > Use GFP_KERNEL_ACCOUNT for the vCPU allocations, the vCPUs are very much > > tied to a single task/VM. For x86, the allocations were accounted up > > until the allocation code was moved to c

Re: [PATCH 1/2] KVM: Account memory allocations for 'struct kvm_vcpu'

2021-03-30 Thread Wanpeng Li
On Wed, 31 Mar 2021 at 10:32, Sean Christopherson wrote: > > Use GFP_KERNEL_ACCOUNT for the vCPU allocations, the vCPUs are very much > tied to a single task/VM. For x86, the allocations were accounted up > until the allocation code was moved to common KVM. For all other > architectures, vCPU al

[PATCH 2/2] KVM: x86: Account a variety of miscellaneous allocations

2021-03-30 Thread Sean Christopherson
Switch to GFP_KERNEL_ACCOUNT for a handful of allocations that are clearly associated with a single task/VM. Note, there are a several SEV allocations that aren't accounted, but those can (hopefully) be fixed by using the local stack for memory. Signed-off-by: Sean Christopherson --- arch/x86/k

[PATCH 1/2] KVM: Account memory allocations for 'struct kvm_vcpu'

2021-03-30 Thread Sean Christopherson
Use GFP_KERNEL_ACCOUNT for the vCPU allocations, the vCPUs are very much tied to a single task/VM. For x86, the allocations were accounted up until the allocation code was moved to common KVM. For all other architectures, vCPU allocations were never previously accounted, but only because most arc

[PATCH] platform/x86: ISST: Account for increased timeout in some cases

2021-03-30 Thread Srinivas Pandruvada
In some cases when firmware is busy or updating, some mailbox commands still timeout on some newer CPUs. To fix this issue, change how we process timeout. With this change, replaced timeout from using simple count with real timeout in micro-seconds using ktime. When the command response takes more

Re: [PATCH v1 5/5] cpuidle: menu: Take negative "sleep length" values into account

2021-03-30 Thread Rafael J. Wysocki
On Tue, Mar 30, 2021 at 4:00 AM Zhou Ti (x2019cwm) wrote: > > On Mon 2021-03-29 14:37 Rafael J. Wysocki wrote: > > Make the menu governor check the tick_nohz_get_next_hrtimer() > > return value so as to avoid dealing with negative "sleep length" > > values and make it use that value directly when

Re: [PATCH v1 5/5] cpuidle: menu: Take negative "sleep length" values into account

2021-03-29 Thread Zhou Ti (x2019cwm)
On Mon 2021-03-29 14:37 Rafael J. Wysocki wrote: > Make the menu governor check the tick_nohz_get_next_hrtimer() > return value so as to avoid dealing with negative "sleep length" > values and make it use that value directly when the tick is stopped. > > While at it, rename local variable delta_ne

Re: [PATCH] KVM: X86: Properly account for guest CPU time when considering context tracking

2021-03-29 Thread Wanpeng Li
On Tue, 30 Mar 2021 at 01:15, Sean Christopherson wrote: > > +Thomas > > On Mon, Mar 29, 2021, Wanpeng Li wrote: > > From: Wanpeng Li > > > > The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 > > reported that the guest time remains 0 when running a while true > > loop in the guest.

[PATCH v1 0/5] cpuidle: Take possible negative "sleep length" values into account

2021-03-29 Thread Rafael J. Wysocki
(patch [2/5]). Next, adjust the teo governor a bit so that negative "sleep length" values are counted like zero by it (patch [3/5]) and modify it so as to avoid mishandling negative "sleep length" values (patch [4/5]). Finally, make the menu governor take negative "sleep le

[PATCH v1 4/5] cpuidle: teo: Take negative "sleep length" values into account

2021-03-29 Thread Rafael J. Wysocki
From: "Rafael J. Wysocki" Modify the TEO governor to take possible negative return values of tick_nohz_get_next_hrtimer() into account by changing the data type of some variables used by it to s64 which allows it to carry out computations without potentially problematic data type c

[PATCH v1 5/5] cpuidle: menu: Take negative "sleep length" values into account

2021-03-29 Thread Rafael J. Wysocki
From: "Rafael J. Wysocki" Subject: [PATCH] cpuidle: menu: Take negative "sleep length" values into account Make the menu governor check the tick_nohz_get_next_hrtimer() return value so as to avoid dealing with negative "sleep length" values and make it use that v

Re: [PATCH] KVM: X86: Properly account for guest CPU time when considering context tracking

2021-03-29 Thread Sean Christopherson
+Thomas On Mon, Mar 29, 2021, Wanpeng Li wrote: > From: Wanpeng Li > > The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 > reported that the guest time remains 0 when running a while true > loop in the guest. > > The commit 87fa7f3e98a131 ("x86/kvm: Move context tracking where i

[PATCH] KVM: X86: Properly account for guest CPU time when considering context tracking

2021-03-29 Thread Wanpeng Li
From: Wanpeng Li The bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=209831 reported that the guest time remains 0 when running a while true loop in the guest. The commit 87fa7f3e98a131 ("x86/kvm: Move context tracking where it belongs") moves guest_exit_irqoff() close to vmexit breaks t

[PATCH v5 06/27] mm/vmstat: Add functions to account folio statistics

2021-03-19 Thread Matthew Wilcox (Oracle)
Allow page counters to be more readily modified by callers which have a folio. Name these wrappers with 'stat' instead of 'state' as requested by Linus here: https://lore.kernel.org/linux-mm/CAHk-=wj847sudr-kt+46ft3+xffgiwpgthvm7djwgdi4cvr...@mail.gmail.com/ Signed-off-by: Matthew Wilcox (Oracle)

Re: [PATCH] x86/cpu/AMD: Adjust x86_phys_bits to account for reduced PA in SEV-* guests

2021-03-17 Thread Peter Gonda
On Wed, Mar 17, 2021 at 3:19 PM Sean Christopherson wrote: > > On Wed, Mar 17, 2021, Sean Christopherson wrote: > > On Wed, Mar 17, 2021, Borislav Petkov wrote: > > > IOW, you have c_bit so your valid address space is [0 .. c_bit-1] no? > > > > I haven't found anything in the GHCB that dictates th

Re: [PATCH] x86/cpu/AMD: Adjust x86_phys_bits to account for reduced PA in SEV-* guests

2021-03-17 Thread Sean Christopherson
On Wed, Mar 17, 2021, Sean Christopherson wrote: > On Wed, Mar 17, 2021, Borislav Petkov wrote: > > IOW, you have c_bit so your valid address space is [0 .. c_bit-1] no? > > I haven't found anything in the GHCB that dictates that MAXPHYADDR == C_BIT-1, > or more specifically that MAXPHYADDR == C_B

Re: [PATCH] x86/cpu/AMD: Adjust x86_phys_bits to account for reduced PA in SEV-* guests

2021-03-17 Thread Sean Christopherson
overlaps MAXPHYADDR (%d bits). > > VMM is buggy or malicious, overriding MAXPHYADDR to %d.\n" > > Not sure about that. This will make a lot of users run scared, not > knowing what's going on and open bugzillas. Yeah, I'm not too sure about it either. I would not

Re: [PATCH] x86/cpu/AMD: Adjust x86_phys_bits to account for reduced PA in SEV-* guests

2021-03-17 Thread Borislav Petkov
make a lot of users run scared, not knowing what's going on and open bugzillas. > + > static void early_detect_mem_encrypt(struct cpuinfo_x86 *c) > { > u64 msr; > > + /* > + * When running as an SEV guest of any flavor, update the physical >

[PATCH] x86/cpu/AMD: Adjust x86_phys_bits to account for reduced PA in SEV-* guests

2021-03-17 Thread Sean Christopherson
/* +* When running as an SEV guest of any flavor, update the physical +* address width to account for the C-bit and clear all of the SME/SVE +* feature flags. As far as the kernel is concerned, the SEV flags +* enumerate what features can be use

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

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

[PATCH 5.11 238/306] net: phy: ti: take into account all possible interrupt sources

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Ioana Ciornei [ Upstream commit 73f476aa1975bae6a792b340f5b26ffcfba869a6 ] The previous implementation of .handle_interrupt() did not take into account the fact that all the interrupt status registers should be acknowledged since multiple interrupt sources could

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

2021-03-13 Thread Andrew Morton
On Sun, 14 Mar 2021 04:11:55 + Matthew Wilcox wrote: > On Sat, Mar 13, 2021 at 12:37:07PM -0800, Andrew Morton wrote: > > On Fri, 5 Mar 2021 04:18:39 + "Matthew Wilcox (Oracle)" > > wrote: > > > > > Allow page counters to be more readily modified by callers which have > > > a folio.

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

2021-03-13 Thread Matthew Wilcox
On Sat, Mar 13, 2021 at 12:37:07PM -0800, Andrew Morton wrote: > On Fri, 5 Mar 2021 04:18:39 + "Matthew Wilcox (Oracle)" > wrote: > > > Allow page counters to be more readily modified by callers which have > > a folio. Name these wrappers with 'stat' instead of 'state' as requested > > by

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

2021-03-13 Thread Andrew Morton
On Fri, 5 Mar 2021 04:18:39 + "Matthew Wilcox (Oracle)" wrote: > Allow page counters to be more readily modified by callers which have > a folio. Name these wrappers with 'stat' instead of 'state' as requested > by Linus here: > https://lore.kernel.org/linux-mm/CAHk-=wj847sudr-kt+46ft3+xff

[PATCH 4.4 28/30] zsmalloc: account the number of compacted pages correctly

2021-03-05 Thread Greg Kroah-Hartman
urn the correct number of pages freed(issued by current shrinker). The fix is simple: 1. account the number of pages freed in zs_compact locally. 2. use actomic variable pages_compacted to accumulate total number. Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-...@tcl.com Fi

[PATCH 4.9 39/41] zsmalloc: account the number of compacted pages correctly

2021-03-05 Thread Greg Kroah-Hartman
urn the correct number of pages freed(issued by current shrinker). The fix is simple: 1. account the number of pages freed in zs_compact locally. 2. use actomic variable pages_compacted to accumulate total number. Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-...@tcl.com Fi

[PATCH 4.14 37/39] zsmalloc: account the number of compacted pages correctly

2021-03-05 Thread Greg Kroah-Hartman
urn the correct number of pages freed(issued by current shrinker). The fix is simple: 1. account the number of pages freed in zs_compact locally. 2. use actomic variable pages_compacted to accumulate total number. Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-...@tcl.com Fi

[PATCH 4.19 48/52] zsmalloc: account the number of compacted pages correctly

2021-03-05 Thread Greg Kroah-Hartman
urn the correct number of pages freed(issued by current shrinker). The fix is simple: 1. account the number of pages freed in zs_compact locally. 2. use actomic variable pages_compacted to accumulate total number. Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-...@tcl.com Fi

[PATCH 5.4 67/72] zsmalloc: account the number of compacted pages correctly

2021-03-05 Thread Greg Kroah-Hartman
urn the correct number of pages freed(issued by current shrinker). The fix is simple: 1. account the number of pages freed in zs_compact locally. 2. use actomic variable pages_compacted to accumulate total number. Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-...@tcl.com Fi

[PATCH 5.10 089/102] zsmalloc: account the number of compacted pages correctly

2021-03-05 Thread Greg Kroah-Hartman
urn the correct number of pages freed(issued by current shrinker). The fix is simple: 1. account the number of pages freed in zs_compact locally. 2. use actomic variable pages_compacted to accumulate total number. Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-...@tcl.com Fi

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

2021-03-04 Thread Matthew Wilcox (Oracle)
Allow page counters to be more readily modified by callers which have a folio. Name these wrappers with 'stat' instead of 'state' as requested by Linus here: https://lore.kernel.org/linux-mm/CAHk-=wj847sudr-kt+46ft3+xffgiwpgthvm7djwgdi4cvr...@mail.gmail.com/ Signed-off-by: Matthew Wilcox (Oracle)

Re: [PATCH v3] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Roman Gushchin
On Wed, Mar 03, 2021 at 11:18:43PM +0800, Muchun Song wrote: > For simplification 991e7673859e ("mm: memcontrol: account kernel stack > per node") has changed the per zone vmalloc backed stack pages > accounting to per node. By doing that we have lost a certain precision &g

[PATCH v3] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Muchun Song
For simplification 991e7673859e ("mm: memcontrol: account kernel stack per node") has changed the per zone vmalloc backed stack pages accounting to per node. By doing that we have lost a certain precision because those pages might live in different NUMA nodes. In the end NR_KERNE

Re: [PATCH v2] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Johannes Weiner
On Wed, Mar 03, 2021 at 05:39:56PM +0800, Muchun Song wrote: > For simplification 991e7673859e ("mm: memcontrol: account kernel stack > per node") has changed the per zone vmalloc backed stack pages > accounting to per node. By doing that we have lost a certain precision &g

Re: [External] Re: [PATCH v2] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Shakeel Butt
On Wed, Mar 3, 2021 at 6:02 AM Michal Hocko wrote: > [...] > > > > + BUG_ON(vm->nr_pages != THREAD_SIZE / PAGE_SIZE); > > > > > > I do not think we need this BUG_ON. What kind of purpose does it serve? > > > > vm->nr_pages should be always equal to THREAD_SIZE / PAGE_SIZE > > if the sy

Re: [External] Re: [PATCH v2] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Michal Hocko
On Wed 03-03-21 21:27:24, Muchun Song wrote: > On Wed, Mar 3, 2021 at 6:25 PM Michal Hocko wrote: > > > > On Wed 03-03-21 17:39:56, Muchun Song wrote: > > > For simplification 991e7673859e ("mm: memcontrol: account kernel stack > > > per node") has chan

Re: [External] Re: [PATCH v2] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Muchun Song
On Wed, Mar 3, 2021 at 6:25 PM Michal Hocko wrote: > > On Wed 03-03-21 17:39:56, Muchun Song wrote: > > For simplification 991e7673859e ("mm: memcontrol: account kernel stack > > per node") has changed the per zone vmalloc backed stack pages > > accounting to pe

Re: [PATCH v2] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Michal Hocko
On Wed 03-03-21 17:39:56, Muchun Song wrote: > For simplification 991e7673859e ("mm: memcontrol: account kernel stack > per node") has changed the per zone vmalloc backed stack pages > accounting to per node. By doing that we have lost a certain precision > because tho

[PATCH v2] mm: memcontrol: fix kernel stack account

2021-03-03 Thread Muchun Song
For simplification 991e7673859e ("mm: memcontrol: account kernel stack per node") has changed the per zone vmalloc backed stack pages accounting to per node. By doing that we have lost a certain precision because those pages might live in different NUMA nodes. In the end NR_KERNE

Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Roman Gushchin
On Tue, Mar 02, 2021 at 08:33:20PM +0100, Michal Hocko wrote: > On Tue 02-03-21 10:50:32, Roman Gushchin wrote: > > On Tue, Mar 02, 2021 at 03:37:33PM +0800, Muchun Song wrote: > > > The alloc_thread_stack_node() cannot guarantee that allocated stack pages > > > are in the same node when CONFIG_VMA

Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 10:50:32, Roman Gushchin wrote: > On Tue, Mar 02, 2021 at 03:37:33PM +0800, Muchun Song wrote: > > The alloc_thread_stack_node() cannot guarantee that allocated stack pages > > are in the same node when CONFIG_VMAP_STACK. Because we do not specify > > __GFP_THISNODE to __vmalloc_nod

Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Roman Gushchin
c_page_state() for each page one by one. Hm, I actually wonder if it makes any sense to split the stack over multiple nodes? Maybe we should fix this instead? > > Fixes: 991e7673859e ("mm: memcontrol: account kernel stack per node") > Signed-off-by: Muchun Song > --- > ke

Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Michal Hocko
> > __GFP_THISNODE to __vmalloc_node_range(). > > Instead of __GFP_THISNODE, mention that the kernel_clone() passes > NUMA_NO_NODE which is being used for __vmalloc_node_range(). If we really want to do this then I would recommend reasoning in the following line: " For simplification 991e767385

Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Shakeel Butt
ion that the kernel_clone() passes NUMA_NO_NODE which is being used for __vmalloc_node_range(). > Fix it by caling calling > mod_lruvec_page_state() for each page one by one. > > Fixes: 991e7673859e ("mm: memcontrol: account kernel stack per node") > Signed-off-by: Muchun Song

Re: [External] Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Shakeel Butt
On Tue, Mar 2, 2021 at 1:34 AM Michal Hocko wrote: > [snip] > > Yeah, imprecision may > > not be a problem. But if this is what we did deliberately, I think that > > it is better to add a comment there. Thanks. > > Yes the comment is quite confusing. I suspect it meant to say > /* All stac

Re: [External] Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 5:34 PM Michal Hocko wrote: > > On Tue 02-03-21 17:23:42, Muchun Song wrote: > > On Tue, Mar 2, 2021 at 4:44 PM Michal Hocko wrote: > > > > > > On Tue 02-03-21 15:37:33, Muchun Song wrote: > > > > The alloc_thread_stack_node() cannot guarantee that allocated stack > > > >

Re: [External] Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 17:23:42, Muchun Song wrote: > On Tue, Mar 2, 2021 at 4:44 PM Michal Hocko wrote: > > > > On Tue 02-03-21 15:37:33, Muchun Song wrote: > > > The alloc_thread_stack_node() cannot guarantee that allocated stack pages > > > are in the same node when CONFIG_VMAP_STACK. Because we do no

Re: [External] Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Muchun Song
cision may not be a problem. But if this is what we did deliberately, I think that it is better to add a comment there. Thanks. > > > Fixes: 991e7673859e ("mm: memcontrol: account kernel stack per node") > > Signed-off-by: Muchun Song > > --- > > kernel/fork.c | 1

Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Michal Hocko
1e7673859e ("mm: memcontrol: account kernel stack per node") > Signed-off-by: Muchun Song > --- > kernel/fork.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/kernel/fork.c b/kernel/fork.c > index d66cd1014211..6e2201feb5

[PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Muchun Song
ntrol: account kernel stack per node") Signed-off-by: Muchun Song --- kernel/fork.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index d66cd1014211..6e2201feb524 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -379,14 +379,19

[PATCH 5.11 641/775] btrfs: account for new extents being deleted in total_bytes_pinned

2021-03-01 Thread Greg Kroah-Hartman
to commit the transaction. We use the space_info->total_bytes_pinned to approximate how much space we have pinned. It's approximate because if we remove a reference to an extent we may free it, but there may be more references to it than we know of at that point, but we account it as pinn

[PATCH 5.11 535/775] ice: Account for port VLAN in VF max packet size calculation

2021-03-01 Thread Greg Kroah-Hartman
From: Brett Creeley [ Upstream commit a6aa7c8f998f4afddd73410aa043dad38162ce9e ] Currently if an AVF driver doesn't account for the possibility of a port VLAN when determining its max packet size then packets at MTU will be dropped. It is not the VF driver's responsibility to account

  1   2   3   4   5   6   7   8   9   10   >