Re: [REGRESSION] x86/efi: Make efi_enter/leave_mm() use the use_/unuse_temporary_mm() machinery (linux-next)

2025-04-30 Thread Peter Zijlstra
On Wed, Apr 30, 2025 at 08:47:43AM +, Borah, Chaitanya Kumar wrote: > > > > -Original Message- > > From: Peter Zijlstra > > Sent: Tuesday, April 29, 2025 11:59 PM > > To: Jani Nikula > > Cc: Borah, Chaitanya Kumar ; > > l...@kernel.org; int

Re: [REGRESSION] x86/efi: Make efi_enter/leave_mm() use the use_/unuse_temporary_mm() machinery (linux-next)

2025-04-30 Thread Peter Zijlstra
On Tue, Apr 29, 2025 at 11:07:45PM -0700, Hugh Dickins wrote: > On Tue, 29 Apr 2025, Peter Zijlstra wrote: > > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c > > index 79c124f6f3f2..39761c7765bd 100644 > > --- a/arch/x86/mm/tlb.c > > +++ b/arch/x86/mm/tlb.c >

Re: [REGRESSION] x86/efi: Make efi_enter/leave_mm() use the use_/unuse_temporary_mm() machinery (linux-next)

2025-04-29 Thread Peter Zijlstra
as > reported by Chaitanya > > Please look into it. Does your kernel include the below? --- commit aef1d0209ddf127a8069aca5fa3a062be4136b76 Author: Peter Zijlstra Date: Fri Apr 18 11:50:34 2025 +0200 x86/mm: Fix {,un}use_temporary_mm() IRQ state As the function switch_mm_irqs_of

Re: [RFT] Revert "lockdep: Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING."

2024-12-12 Thread Peter Zijlstra
On Tue, Dec 10, 2024 at 06:00:33PM -0600, Lucas De Marchi wrote: > raw_spin_lock_init(&guc->timestamp.lock); > raw_spin_lock_init(&pmu->lock); > raw_spin_lock_init(&i915->mmio_debug.lock); > raw_spin_lock_init(&uncore->lock); > > And it's still not sufficient, because inte

Re: [PATCH 6/7] drm/i915/pmu: Lazy unregister

2024-07-24 Thread Peter Zijlstra
On Tue, Jul 23, 2024 at 10:30:08AM -0500, Lucas De Marchi wrote: > On Tue, Jul 23, 2024 at 09:03:25AM GMT, Tvrtko Ursulin wrote: > > > > On 22/07/2024 22:06, Lucas De Marchi wrote: > > > Instead of calling perf_pmu_unregister() when unbinding, defer that to > > > the destruction of i915 object. Si

Re: [PATCH 5/5] fs: Convert struct file::f_count to refcount_long_t

2024-05-03 Thread Peter Zijlstra
On Fri, May 03, 2024 at 11:37:25AM +0200, Christian Brauner wrote: > On Thu, May 02, 2024 at 05:41:23PM -0700, Kees Cook wrote: > > On Fri, May 03, 2024 at 01:14:45AM +0100, Al Viro wrote: > > > On Thu, May 02, 2024 at 05:10:18PM -0700, Kees Cook wrote: > > > > > > > But anyway, there needs to be

Re: [Intel-gfx] [PATCH v5 0/7] Introduce __xchg, non-atomic xchg

2023-02-27 Thread Peter Zijlstra
On Thu, Feb 23, 2023 at 10:24:19PM +0100, Andrzej Hajda wrote: > On 22.02.2023 18:04, Peter Zijlstra wrote: > > On Wed, Jan 18, 2023 at 04:35:22PM +0100, Andrzej Hajda wrote: > > > > > Andrzej Hajda (7): > > >arch: rename all internal names __xchg to __arch

Re: [Intel-gfx] [PATCH v5 0/7] Introduce __xchg, non-atomic xchg

2023-02-22 Thread Peter Zijlstra
On Wed, Jan 18, 2023 at 04:35:22PM +0100, Andrzej Hajda wrote: > Andrzej Hajda (7): > arch: rename all internal names __xchg to __arch_xchg > linux/include: add non-atomic version of xchg > arch/*/uprobes: simplify arch_uretprobe_hijack_return_addr > llist: simplify __llist_del_all > io_

Re: [Intel-gfx] [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-02-02 Thread Peter Zijlstra
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 2d6d790d9bed..6c7c70bf50dd 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -491,7 +491,13 @@ struct vm_area_struct { >

Re: [Intel-gfx] [PATCH v2 20/20] jump_label: RFC - tolerate toggled state

2023-01-17 Thread Peter Zijlstra
On Fri, Jan 13, 2023 at 12:30:16PM -0700, Jim Cromie wrote: > __jump_label_patch currently will "crash the box" if it finds a > jump_entry not as expected. ISTM this overly harsh; it doesn't > distinguish between "alternate/opposite" state, and truly > "insane/corrupted". > > The "opposite" (but

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-11-02 Thread Peter Zijlstra
On Wed, Nov 02, 2022 at 06:57:51PM +0200, Ville Syrjälä wrote: > On Thu, Oct 27, 2022 at 06:53:23PM +0200, Peter Zijlstra wrote: > > On Thu, Oct 27, 2022 at 04:09:01PM +0300, Ville Syrjälä wrote: > > > On Wed, Oct 26, 2022 at 01:43:00PM +0200, Peter Zijlstra wrote: > >

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-10-27 Thread Peter Zijlstra
On Thu, Oct 27, 2022 at 04:09:01PM +0300, Ville Syrjälä wrote: > On Wed, Oct 26, 2022 at 01:43:00PM +0200, Peter Zijlstra wrote: > > Could you please give the below a spin? > > Thanks. I've added this to our CI branch. I'll try to keep and eye > on it in the com

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-10-27 Thread Peter Zijlstra
On Thu, Oct 27, 2022 at 01:58:09PM +0800, Chen Yu wrote: > > It's a very narrow race between schedule() and task_call_func(). > > > > CPU0 CPU1 > > > > __schedule() > > rq_lock(); > > prev_state = READ_ONCE(prev->__state); > > if (...

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-10-26 Thread Peter Zijlstra
On Wed, Oct 26, 2022 at 02:12:02PM +0200, Peter Zijlstra wrote: > On Wed, Oct 26, 2022 at 01:43:00PM +0200, Peter Zijlstra wrote: > > On Wed, Oct 26, 2022 at 01:32:31PM +0300, Ville Syrjälä wrote: > > > Short form looks to be this: > > > <4>[ 355.437846] 1 lock he

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-10-26 Thread Peter Zijlstra
On Wed, Oct 26, 2022 at 01:43:00PM +0200, Peter Zijlstra wrote: > On Wed, Oct 26, 2022 at 01:32:31PM +0300, Ville Syrjälä wrote: > > Short form looks to be this: > > <4>[ 355.437846] 1 lock held by rs:main Q:Reg/359: > > <4>[ 355.438418] #0: 88844693b

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-10-26 Thread Peter Zijlstra
On Wed, Oct 26, 2022 at 01:32:31PM +0300, Ville Syrjälä wrote: > Short form looks to be this: > <4>[ 355.437846] 1 lock held by rs:main Q:Reg/359: > <4>[ 355.438418] #0: 88844693b758 (&rq->__lock){-.-.}-{2:2}, at: > raw_spin_rq_lock_nested+0x1b/0x30 > <4>[ 355.438432] rs:main Q:Reg/359 hol

Re: [Intel-gfx] [PATCH v3 6/6] freezer, sched: Rewrite core freezer logic

2022-10-25 Thread Peter Zijlstra
On Tue, Oct 25, 2022 at 07:52:07AM +0300, Ville Syrjälä wrote: > On Fri, Oct 21, 2022 at 08:22:41PM +0300, Ville Syrjälä wrote: > > On Mon, Aug 22, 2022 at 01:18:22PM +0200, Peter Zijlstra wrote: > > > +#ifdef CONFIG_LOCKDEP > > > + /* > > > + * It's dang

Re: [Intel-gfx] [PATCH 15/15] seqlock: drop seqcount_ww_mutex_t

2022-04-07 Thread Peter Zijlstra
On Thu, Apr 07, 2022 at 10:59:46AM +0200, Christian König wrote: > Daniel pointed out that this series removes the last user of > seqcount_ww_mutex_t, so let's drop this. > > Signed-off-by: Christian König Acked-by: Peter Zijlstra (Intel)

Re: [Intel-gfx] [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1)

2022-02-11 Thread Peter Zijlstra
On Thu, Feb 10, 2022 at 09:55:27PM -0800, Namhyung Kim wrote: > So you are ok with adding two new tracepoints, even if they are > similar to what we already have in lockdep/lock_stat, right? Yeah, I don't think adding tracepoints to the slowpaths of the various locks should be a problem.

Re: [Intel-gfx] [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1)

2022-02-10 Thread Peter Zijlstra
On Wed, Feb 09, 2022 at 04:32:58PM -0800, Namhyung Kim wrote: > On Wed, Feb 9, 2022 at 1:09 AM Peter Zijlstra wrote: > > > > On Tue, Feb 08, 2022 at 10:41:56AM -0800, Namhyung Kim wrote: > > > > > Eventually I'm mostly interested in the contended locks only and

Re: [Intel-gfx] [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1)

2022-02-10 Thread Peter Zijlstra
On Wed, Feb 09, 2022 at 03:17:38PM -0500, Waiman Long wrote: > > On 2/9/22 14:45, Namhyung Kim wrote: > > On Wed, Feb 9, 2022 at 11:28 AM Mathieu Desnoyers > > wrote: > > > - On Feb 9, 2022, at 2:22 PM, Namhyung Kim namhy...@kernel.org wrote: > > > > I'm also concerning dynamic allocated lock

Re: [Intel-gfx] [RFC 00/12] locking: Separate lock tracepoints from lockdep/lock_stat (v1)

2022-02-09 Thread Peter Zijlstra
On Tue, Feb 08, 2022 at 10:41:56AM -0800, Namhyung Kim wrote: > Eventually I'm mostly interested in the contended locks only and I > want to reduce the overhead in the fast path. By moving that, it'd be > easy to track contended locks with timing by using two tracepoints. So why not put in two n

Re: [Intel-gfx] [PATCH 0/2] Nuke PAGE_KERNEL_IO

2021-11-12 Thread Peter Zijlstra
| 7 --- > arch/x86/mm/ioremap.c | 2 +- > arch/x86/xen/setup.c | 2 +- > drivers/gpu/drm/i915/gem/i915_gem_pages.c | 4 ++-- > include/asm-generic/fixmap.h | 2 +- > 6 files changed, 6 insertions(+), 13 deletions(-) Acked-by: Peter Zijlstra (Intel)

Re: [Intel-gfx] [PATCH 2/4] mm: add a io_mapping_map_user helper

2021-10-20 Thread Peter Zijlstra
On Wed, Oct 20, 2021 at 08:40:05AM -0700, Lucas De Marchi wrote: > On Fri, Mar 26, 2021 at 06:55:03AM +0100, Christoph Hellwig wrote: > > Add a helper that calls remap_pfn_range for an struct io_mapping, relying > > on the pgprot pre-validation done when creating the mapping instead of > > doing it

Re: [Intel-gfx] [PATCH 8/8] drm/i915: Don't disable interrupts and pretend a lock as been acquired in __timeline_mark_lock().

2021-10-05 Thread Peter Zijlstra
ave been acquired, false if other magic is involved and the lock > is not needed. Use the `false' argument only from within > switch_to_kernel_context() and remove __timeline_mark_lock(). > > Cc: Peter Zijlstra > Signed-off-by: Sebastian Andrzej Siewior Eeew,

Re: [Intel-gfx] [RFC 1/6] sched: Add nice value change notifier

2021-10-04 Thread Peter Zijlstra
On Mon, Oct 04, 2021 at 09:12:37AM +0100, Tvrtko Ursulin wrote: > On 01/10/2021 16:48, Peter Zijlstra wrote: > > Hmm? That's for normalize_rt_tasks() only, right? Just don't have it > > call the notifier in that special case (that's a magic sysrq thing > >

Re: [Intel-gfx] [RFC 1/6] sched: Add nice value change notifier

2021-10-01 Thread Peter Zijlstra
On Fri, Oct 01, 2021 at 11:32:16AM +0100, Tvrtko Ursulin wrote: > > On 01/10/2021 10:04, Tvrtko Ursulin wrote: > > > > Hi Peter, > > > > On 30/09/2021 19:33, Peter Zijlstra wrote: > > > On Thu, Sep 30, 2021 at 06:15:47PM +0100, Tvrtko Ursulin wro

Re: [Intel-gfx] [RFC 0/6] CPU + GPU synchronised priority scheduling

2021-09-30 Thread Peter Zijlstra
On Thu, Sep 30, 2021 at 06:15:46PM +0100, Tvrtko Ursulin wrote: > (Note I did not copy > everyone on all patches but just the cover letter for context and the rest > should be available from the mailing list.) In general, if you can't be arsed to send it to me, I can't be arsed to dig it out.

Re: [Intel-gfx] [RFC 1/6] sched: Add nice value change notifier

2021-09-30 Thread Peter Zijlstra
On Thu, Sep 30, 2021 at 06:15:47PM +0100, Tvrtko Ursulin wrote: > void set_user_nice(struct task_struct *p, long nice) > { > bool queued, running; > - int old_prio; > + int old_prio, ret; > struct rq_flags rf; > struct rq *rq; > > @@ -6913,6 +6945,9 @@ void set_user_ni

Re: [Intel-gfx] [PATCH v2] kernel/locking: Add context to ww_mutex_trylock.

2021-09-17 Thread Peter Zijlstra
On Thu, Sep 16, 2021 at 03:28:11PM +0200, Peter Zijlstra wrote: > On Thu, Sep 16, 2021 at 03:00:39PM +0200, Maarten Lankhorst wrote: > > > > For merge logistics, can we pls have a stable branch? I expect that the > > > i915 patches will be ready for 5.16. > > >

Re: [Intel-gfx] [PATCH v2] kernel/locking: Add context to ww_mutex_trylock.

2021-09-16 Thread Peter Zijlstra
On Thu, Sep 16, 2021 at 03:00:39PM +0200, Maarten Lankhorst wrote: > > For merge logistics, can we pls have a stable branch? I expect that the > > i915 patches will be ready for 5.16. > > > > Or send it in for -rc2 so that the interface change doesn't cause needless > > conflicts, whatever you thi

Re: [Intel-gfx] [PATCH v2] kernel/locking: Add context to ww_mutex_trylock.

2021-09-13 Thread Peter Zijlstra
priority, but it requires a rework of the entire driver, which can only be done one step at a time. As an intermediate solution, add an acquire context to ww_mutex_trylock, which allows us to do proper nesting annotations on the trylocks, making the above lockdep splat disappear. This is also usef

Re: [Intel-gfx] [PATCH v2] kernel/locking: Add context to ww_mutex_trylock.

2021-09-10 Thread Peter Zijlstra
On Fri, Sep 10, 2021 at 05:02:54PM +0200, Peter Zijlstra wrote: > That doesn't look right, how's this for you? Full patch for the robots here: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=locking/core&id=826e7b8826f0af185bb93249600533c33fd69a95

Re: [Intel-gfx] [PATCH v2] kernel/locking: Add context to ww_mutex_trylock.

2021-09-10 Thread Peter Zijlstra
On Thu, Sep 09, 2021 at 11:32:18AM +0200, Maarten Lankhorst wrote: > diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c > index d456579d0952..791c28005eef 100644 > --- a/kernel/locking/mutex.c > +++ b/kernel/locking/mutex.c > @@ -736,6 +736,44 @@ __ww_mutex_lock(struct mutex *lock, unsign

Re: [Intel-gfx] [PATCH] kernel/locking: Add context to ww_mutex_trylock.

2021-09-09 Thread Peter Zijlstra
On Thu, Sep 09, 2021 at 07:38:06AM +0200, Maarten Lankhorst wrote: > > You'll need a similar hunk in ww_rt_mutex.c > > What tree has that file? Linus' tree should have it. Per commit: f8635d509d80 ("locking/ww_mutex: Implement rtmutex based ww_mutex API functions")

Re: [Intel-gfx] [PATCH] kernel/locking: Add context to ww_mutex_trylock.

2021-09-08 Thread Peter Zijlstra
On Tue, Sep 07, 2021 at 03:20:44PM +0200, Maarten Lankhorst wrote: > i915 will soon gain an eviction path that trylock a whole lot of locks > for eviction, getting dmesg failures like below: > > BUG: MAX_LOCK_DEPTH too low! > turning off the locking correctness validator. > depth: 48 max: 48! > 4

Re: [Intel-gfx] [PATCH 1/3] drm: use the lookup lock in drm_is_current_master

2021-07-29 Thread Peter Zijlstra
On Thu, Jul 29, 2021 at 10:32:13PM +0800, Desmond Cheong Zhi Xi wrote: > Sounds good, will do. Thanks for the patch, Peter. > > Just going to make a small edit: > s/LOCK_STAT_NOT_HELD/LOCK_STATE_NOT_HELD/ Bah, I knew I should've compile tested it :-), Thanks! _

Re: [Intel-gfx] [PATCH 1/3] drm: use the lookup lock in drm_is_current_master

2021-07-27 Thread Peter Zijlstra
cking/lockdep: Provide lockdep_assert{,_once}() helpers Extract lockdep_assert{,_once}() helpers to more easily write composite assertions like, for example: lockdep_assert(lockdep_is_held(&drm_device.master_mutex) || lockdep_is_held(&drm_file.master_lookup_lock)); Signed-o

Re: [Intel-gfx] 5.13 i915/PAT regression on Brasswell, adding nopat to the kernel commandline worksaround this

2021-05-12 Thread Peter Zijlstra
On Wed, May 12, 2021 at 11:57:02AM +0200, Hans de Goede wrote: > Hi All, > > I'm not sure if this is a i915 bug, or caused by changes elsewhere in the > kernel, > so I thought it would be best to just send out an email and then see from > there. > > With 5.13-rc1 gdm fails to show and dmesg con

Re: [Intel-gfx] [PATCH 4/7] mm: Introduce verify_page_range()

2021-04-14 Thread Peter Zijlstra
On Tue, Apr 13, 2021 at 08:01:08PM -0700, Kees Cook wrote: > So the addr can just be encoded in "int", and no structure is needed at: > > typedef bool (*vpr_fn_t)(pte_t pte); > > static int vpr_fn(pte_t *pte, unsigned long addr, void *data) > { > vpr_fn_t callback = data; > > if (!ca

Re: [Intel-gfx] [PATCH 4/7] mm: Introduce verify_page_range()

2021-04-13 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 01:05:09PM -0700, Kees Cook wrote: > On Mon, Apr 12, 2021 at 10:00:16AM +0200, Peter Zijlstra wrote: > > +struct vpr_data { > > + int (*fn)(pte_t pte, unsigned long addr, void *data); > > + void *data; > > +}; > > Eeerg. This is likely

Re: [Intel-gfx] [PATCH 6/7] i915: Convert to verify_page_range()

2021-04-12 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 01:08:38PM -0700, Kees Cook wrote: > On Mon, Apr 12, 2021 at 10:00:18AM +0200, Peter Zijlstra wrote: > > @@ -1249,14 +1249,14 @@ static int check_absent_pte(pte_t *pte, > > > > static int check_present(unsigned long addr, unsigned long len)

Re: [Intel-gfx] [PATCH 4/7] mm: Introduce verify_page_range()

2021-04-12 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 01:05:09PM -0700, Kees Cook wrote: > On Mon, Apr 12, 2021 at 10:00:16AM +0200, Peter Zijlstra wrote: > > +struct vpr_data { > > + int (*fn)(pte_t pte, unsigned long addr, void *data); > > + void *data; > > +}; > > Eeerg. This is likely

Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for mm: Unexport apply_to_page_range()

2021-04-12 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 09:00:16AM -, Patchwork wrote: > == Series Details == > > Series: mm: Unexport apply_to_page_range() > URL : https://patchwork.freedesktop.org/series/88943/ > State : failure > > == Summary == > > CALLscripts/checksyscalls.sh > CALLscripts/atomic/check-ato

Re: [Intel-gfx] [PATCH 2/7] xen/gntdev, x86: Remove apply_to_page_range() use from module

2021-04-12 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 10:26:40AM +0200, Christoph Hellwig wrote: > On Mon, Apr 12, 2021 at 10:00:14AM +0200, Peter Zijlstra wrote: > > Instead of relying on apply_to_page_range() being available to > > modules, move its use into core kernel code and export it's > > appl

Re: [Intel-gfx] [PATCH 4/7] mm: Introduce verify_page_range()

2021-04-12 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 10:28:05AM +0200, Christoph Hellwig wrote: > On Mon, Apr 12, 2021 at 10:00:16AM +0200, Peter Zijlstra wrote: > > +extern int verify_page_range(struct mm_struct *mm, > > No need for the extern here. It's consistent with the rest of the functions there

Re: [Intel-gfx] [PATCH 3/7] xen/gntdev: Remove apply_to_page_range() use from module

2021-04-12 Thread Peter Zijlstra
On Mon, Apr 12, 2021 at 10:27:21AM +0200, Christoph Hellwig wrote: > On Mon, Apr 12, 2021 at 10:00:15AM +0200, Peter Zijlstra wrote: > > --- a/drivers/xen/grant-table.c > > +++ b/drivers/xen/grant-table.c > > @@ -1591,6 +1591,43 @@ int gnttab_init(void) > > } > &g

[Intel-gfx] [PATCH 2/7] xen/gntdev, x86: Remove apply_to_page_range() use from module

2021-04-12 Thread Peter Zijlstra
Instead of relying on apply_to_page_range() being available to modules, move its use into core kernel code and export it's application. NOTE: ideally we do: use_ptemod = !auto_translate_physmap && gnttab_map_avail_bits and remove this hack. Signed-off-by: Peter Zijlstra (Intel)

[Intel-gfx] [PATCH 3/7] xen/gntdev: Remove apply_to_page_range() use from module

2021-04-12 Thread Peter Zijlstra
Instead of relying on apply_to_page_range() being available to modules, move its use into core kernel code and export it's application. Signed-off-by: Peter Zijlstra (Intel) --- drivers/xen/gntdev-common.h |2 ++ drivers/xen/gntdev.c| 30 +- driver

[Intel-gfx] [PATCH 4/7] mm: Introduce verify_page_range()

2021-04-12 Thread Peter Zijlstra
Introduce and EXPORT a read-only counterpart to apply_to_page_range(). It only exposes the PTE value, not a pointer to the pagetables itself and is thus quite a bit safer to export. A number of apply_to_page_range() users can be converted to this primitive. Signed-off-by: Peter Zijlstra (Intel

[Intel-gfx] [PATCH 6/7] i915: Convert to verify_page_range()

2021-04-12 Thread Peter Zijlstra
check_{present,absent}() only need R/O access, use verify_page_range() instead to remove modular use of apply_to_page_range(). Signed-off-by: Peter Zijlstra (Intel) --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 16 1 file changed, 8 insertions(+), 8 deletions

[Intel-gfx] [PATCH 0/7] mm: Unexport apply_to_page_range()

2021-04-12 Thread Peter Zijlstra
Hi, These patches remove the last few modular apply_to_page_range() users and unexports these interface. Since these functions provide direct access to our page-tables they're a prime target for nefarious activities. These patches rely on the remap_pfn_range_notrack() patches from Christoph that

[Intel-gfx] [PATCH 7/7] mm: Unexport apply_to_page_range()

2021-04-12 Thread Peter Zijlstra
Now that all module users of apply_to_page_range() have been removed, unexport this function. This is an unsafe function in that it gives direct access to the page-tables. Signed-off-by: Peter Zijlstra (Intel) --- mm/memory.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) --- a

[Intel-gfx] [PATCH 5/7] xen/privcmd: Use verify_page_range()

2021-04-12 Thread Peter Zijlstra
Avoid using apply_to_page_range() from modules, use the safer verify_page_range() instead. Signed-off-by: Peter Zijlstra (Intel) --- drivers/xen/privcmd.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -946,9 +946,9

[Intel-gfx] [PATCH 1/7] mm: Unexport apply_to_existing_page_range()

2021-04-12 Thread Peter Zijlstra
There are no modular in-tree users, remove the EXPORT. This is an unsafe function in that it gives direct access to the page-tables. Signed-off-by: Peter Zijlstra (Intel) --- mm/memory.c |1 - 1 file changed, 1 deletion(-) --- a/mm/memory.c +++ b/mm/memory.c @@ -2558,7 +2558,6 @@ int

Re: [Intel-gfx] [drm:gen8_de_irq_handler [i915]] *ERROR* Fault errors on pipe B: 0x00000080

2021-04-07 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 09:18:51AM -0400, Rodrigo Vivi wrote: > On Thu, Jun 04, 2020 at 12:11:07PM +0200, Peter Zijlstra wrote: > > On Tue, Jun 02, 2020 at 08:27:10PM +0200, Peter Zijlstra wrote: > > > On Tue, Jun 02, 2020 at 06:08:03PM +, Souza, Jose wrote: > > >

Re: [Intel-gfx] [PATCH 3/3] locking/selftests: Add testcases for fs_reclaim

2020-11-20 Thread Peter Zijlstra
gt; Cc: "Matthew Wilcox (Oracle)" > Signed-off-by: Daniel Vetter > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Will Deacon > Cc: linux-ker...@vger.kernel.org > --- > lib/locking-selftest.c | 47 ++ > 1 file changed, 47 in

Re: [Intel-gfx] [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-24 Thread Peter Zijlstra
On Thu, Sep 24, 2020 at 09:51:38AM -0400, Steven Rostedt wrote: > > It turns out, that getting selected for pull-balance is exactly that > > condition, and clearly a migrate_disable() task cannot be pulled, but we > > can use that signal to try and pull away the running task that's in the > > way.

Re: [Intel-gfx] [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-24 Thread Peter Zijlstra
On Thu, Sep 24, 2020 at 08:32:41AM -0400, Steven Rostedt wrote: > Anyway, instead of blocking. What about having a counter of number of > migrate disabled tasks per cpu, and when taking a migrate_disable(), and > there's > already another task with migrate_disabled() set, and the current task has

Re: [Intel-gfx] [PATCH v8 00/12] Introduce CAP_PERFMON to secure system performance monitoring and observability

2020-07-14 Thread Peter Zijlstra
On Mon, Jul 13, 2020 at 03:51:52PM -0300, Arnaldo Carvalho de Melo wrote: > > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > > index 856d98c36f56..a2397f724c10 100644 > > > --- a/kernel/events/core.c > > > +++ b/kernel/events/core.c > > > @@ -11595,7 +11595,7 @@ SYSCALL_DEFINE5(per

Re: [Intel-gfx] [drm:gen8_de_irq_handler [i915]] *ERROR* Fault errors on pipe B: 0x00000080

2020-06-02 Thread Peter Zijlstra
On Tue, Jun 02, 2020 at 06:08:03PM +, Souza, Jose wrote: > Hi Peter > Please file a bug by follow this instructions: > https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs *sigh*, top posting and webforms :-( Steps to reproduce: Boot into X How often: Always uname -r: 5.6

[Intel-gfx] [drm:gen8_de_irq_handler [i915]] *ERROR* Fault errors on pipe B: 0x00000080

2020-06-02 Thread Peter Zijlstra
Hi All, My desktop (Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz) is spewing tons and tons of: [ 778.461227] [drm:gen8_de_irq_handler [i915]] *ERROR* Fault errors on pipe B: 0x0080 [ 778.477763] [drm:gen8_de_irq_handler [i915]] *ERROR* Fault errors on pipe B: 0x0080 [ 778.577718] [drm:g

Re: [Intel-gfx] [RFC] GPU-bound energy efficiency improvements for the intel_pstate driver (v2.99)

2020-05-11 Thread Peter Zijlstra
On Mon, Apr 27, 2020 at 08:22:47PM -0700, Francisco Jerez wrote: > This addresses the technical concerns people brought up about my > previous v2 revision of this series. Other than a few bug fixes, the > only major change relative to v2 is that the controller is now exposed > as a new CPUFREQ gen

Re: [Intel-gfx] rcu_barrier() no longer allowed within mmap_sem?

2020-03-30 Thread Peter Zijlstra
On Mon, Mar 30, 2020 at 03:00:35PM +0200, Daniel Vetter wrote: > Hi all, for all = rcu, cpuhotplug and perf maintainers > > We've hit an interesting new lockdep splat in our drm/i915 CI: > > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17096/shard-tglb7/igt@kms_frontbuffer_track...@fbcpsr-r

Re: [Intel-gfx] [PATCH 01/10] PM: QoS: Add CPU_RESPONSE_FREQUENCY global PM QoS limit.

2020-03-11 Thread Peter Zijlstra
On Tue, Mar 10, 2020 at 02:41:54PM -0700, Francisco Jerez wrote: > +static void cpu_response_frequency_qos_apply(struct pm_qos_request *req, > + enum pm_qos_req_action action, > + s32 value) > +{ > + int ret = pm_

Re: [Intel-gfx] [PATCH] drm/i915: Minimize uaccess exposure in i915_gem_execbuffer2_ioctl()

2020-02-28 Thread Peter Zijlstra
On Thu, Feb 27, 2020 at 07:03:42PM -0600, Josh Poimboeuf wrote: > > And why not mark gen8_canonical_addr() __always_inline? > > Right, marking those two functions as __always_inline is the other > option. The problem is, if you keep doing it, eventually you end up > with __always_inline-itis spre

Re: [Intel-gfx] [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process

2020-01-10 Thread Peter Zijlstra
On Thu, Jan 09, 2020 at 02:36:50PM +0300, Alexey Budankov wrote: > On 08.01.2020 19:07, Peter Zijlstra wrote: > > On Wed, Dec 18, 2019 at 12:25:35PM +0300, Alexey Budankov wrote: > >> diff --git a/kernel/events/core.c b/kernel/events/core.c > >> index 059ee7116008..d9d

Re: [Intel-gfx] [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process

2020-01-08 Thread Peter Zijlstra
On Wed, Dec 18, 2019 at 12:25:35PM +0300, Alexey Budankov wrote: > > Open access to perf_events monitoring for CAP_SYS_PERFMON privileged > processes. For backward compatibility reasons access to perf_events > subsystem remains open for CAP_SYS_ADMIN privileged processes but > CAP_SYS_ADMIN usage

Re: [Intel-gfx] [PATCH -next] treewide: remove unused argument in lock_release()

2019-10-08 Thread Peter Zijlstra
On Tue, Oct 08, 2019 at 06:33:51PM +0200, Daniel Vetter wrote: > On Thu, Sep 19, 2019 at 12:09:40PM -0400, Qian Cai wrote: > > Since the commit b4adfe8e05f1 ("locking/lockdep: Remove unused argument > > in __lock_release"), @nested is no longer used in lock_release(), so > > remove it from all lock

Re: [Intel-gfx] [PATCH -next] treewide: remove unused argument in lock_release()

2019-09-30 Thread Peter Zijlstra
On Thu, Sep 19, 2019 at 12:09:40PM -0400, Qian Cai wrote: > Since the commit b4adfe8e05f1 ("locking/lockdep: Remove unused argument > in __lock_release"), @nested is no longer used in lock_release(), so > remove it from all lock_release() calls and friends. Right; I never did this cleanup for not

Re: [Intel-gfx] [PATCH 3/4] kernel.h: Add non_block_start/end()

2019-08-23 Thread Peter Zijlstra
On Fri, Aug 23, 2019 at 03:42:47PM +0200, Daniel Vetter wrote: > I'm assuming the lockdep one will land, so not going to resend that. I was assuming you'd wake the might_lock_nested() along with the i915 user through the i915/drm tree. If want me to take some or all of that, lemme know. __

Re: [Intel-gfx] [PATCH 3/4] kernel.h: Add non_block_start/end()

2019-08-23 Thread Peter Zijlstra
On Fri, Aug 23, 2019 at 09:12:34AM -0300, Jason Gunthorpe wrote: > I still haven't heard a satisfactory answer why a whole new scheme is > needed and a simple: > >if (IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP)) > preempt_disable() > > isn't sufficient to catch the problematic cases during

Re: [Intel-gfx] [PATCH 3/3] drm/i915: use might_lock_nested in get_pages annotation

2019-08-23 Thread Peter Zijlstra
On Tue, Aug 20, 2019 at 10:19:51AM +0200, Daniel Vetter wrote: > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h > b/drivers/gpu/drm/i915/gem/i915_gem_object.h > index a0b1fa8a3224..b3fd6aac93bc 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h > +++ b/drivers/gpu/drm/i915/gem/i915

Re: [Intel-gfx] [PATCH 2/3] lockdep: add might_lock_nested()

2019-08-23 Thread Peter Zijlstra
On Tue, Aug 20, 2019 at 10:19:50AM +0200, Daniel Vetter wrote: > Necessary to annotate functions where we might acquire a > mutex_lock_nested() or similar. Needed by i915. > > Signed-off-by: Daniel Vetter > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Will De

Re: [Intel-gfx] [PATCH 3/4] kernel.h: Add non_block_start/end()

2019-08-23 Thread Peter Zijlstra
rks better when I actually squash in the fixup I had lying > > around :-/ > > > > v4: Pick the suggestion from Andrew Morton to give non_block_start/end > > some good kerneldoc comments. I added that other blocking calls like > > wait_event pose similar issues, since t

Re: [Intel-gfx] [PATCH 00/34] put_user_pages(): miscellaneous call sites

2019-08-02 Thread Peter Zijlstra
On Thu, Aug 01, 2019 at 07:16:19PM -0700, john.hubb...@gmail.com wrote: > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d > ("mm: introduce put_user_page*(), placeholder versions"). That commit > has an extensive description of the problem and the planned steps to > solve

Re: [Intel-gfx] [RFC][PATCH] wake_up_var() memory ordering

2019-06-25 Thread Peter Zijlstra
On Tue, Jun 25, 2019 at 02:12:22PM +0200, Andreas Gruenbacher wrote: > > Only if we do as David suggested and make clean_and_wake_up_bit() > > provide the RELEASE barrier. > > (It's clear_and_wake_up_bit, not clean_and_wake_up_bit.) Yes, typing hard. > > That is, currently clear_and_wake_up_bit

Re: [Intel-gfx] [RFC][PATCH] wake_up_var() memory ordering

2019-06-25 Thread Peter Zijlstra
On Tue, Jun 25, 2019 at 11:19:35AM +0200, Andreas Gruenbacher wrote: > > diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c > > index cf4c767005b1..29ea5da7 100644 > > --- a/fs/gfs2/glops.c > > +++ b/fs/gfs2/glops.c > > @@ -227,6 +227,7 @@ static void gfs2_clear_glop_pending(struct gfs2_inode > >

Re: [Intel-gfx] [RFC][PATCH] wake_up_var() memory ordering

2019-06-25 Thread Peter Zijlstra
(sorry for cross-posting to moderated lists btw, I've since acquired a patch to get_maintainers.pl that wil exclude them in the future) On Tue, Jun 25, 2019 at 08:51:01AM +0100, David Howells wrote: > Peter Zijlstra wrote: > > > I tried using wake_up_var() today and accident

[Intel-gfx] [RFC][PATCH] wake_up_var() memory ordering

2019-06-24 Thread Peter Zijlstra
Hi all, I tried using wake_up_var() today and accidentally noticed that it didn't imply an smp_mb() and specifically requires it through wake_up_bit() / waitqueue_active(). Now, wake_up_bit() doesn't imply the barrier because it is assumed to be used with the atomic bitops API which either implie

Re: [Intel-gfx] [PATCH] RFC: console: hack up console_lock more v3

2019-05-09 Thread Peter Zijlstra
On Thu, May 09, 2019 at 03:06:09PM +0200, Daniel Vetter wrote: > On Thu, May 9, 2019 at 2:31 PM Peter Zijlstra wrote: > > On Thu, May 09, 2019 at 02:09:03PM +0200, Daniel Vetter wrote: > > > Fix this by creating a prinkt_safe_up() which calls wake_up_process > > > ou

Re: [Intel-gfx] [PATCH] RFC: console: hack up console_lock more v2

2019-05-09 Thread Peter Zijlstra
On Thu, May 09, 2019 at 11:32:57AM +0100, Chris Wilson wrote: > Quoting Daniel Vetter (2019-05-06 08:45:53) > > +/** > > + * printk_safe_up - release the semaphore in console_unlock > > + * @sem: the semaphore to release > > + * > > + * Release the semaphore. Unlike mutexes, up() may be called fro

Re: [Intel-gfx] [PATCH] RFC: console: hack up console_lock more v3

2019-05-09 Thread Peter Zijlstra
On Thu, May 09, 2019 at 02:09:03PM +0200, Daniel Vetter wrote: > Fix this by creating a prinkt_safe_up() which calls wake_up_process > outside of the spinlock. This isn't correct in full generality, but > good enough for console_lock: > > - console_lock doesn't use interruptible or killable or tim

Re: [Intel-gfx] [patch V3 18/29] lockdep: Remove save argument from check_prev_add()

2019-04-25 Thread Peter Zijlstra
On Thu, Apr 25, 2019 at 11:45:11AM +0200, Thomas Gleixner wrote: > There is only one caller which hands in save_trace as function pointer. > > Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) ___ Intel-gfx mailing list

Re: [Intel-gfx] [patch V2 19/29] lockdep: Simplify stack trace handling

2019-04-24 Thread Peter Zijlstra
On Thu, Apr 18, 2019 at 10:41:38AM +0200, Thomas Gleixner wrote: > Replace the indirection through struct stack_trace by using the storage > array based interfaces and storing the information is a small lockdep > specific data structure. > Acked-by: Peter Zij

Re: [Intel-gfx] [patch V2 18/29] lockdep: Move stack trace logic into check_prev_add()

2019-04-24 Thread Peter Zijlstra
On Thu, Apr 18, 2019 at 10:41:37AM +0200, Thomas Gleixner wrote: > There is only one caller of check_prev_add() which hands in a zeroed struct > stack trace and a function pointer to save_stack(). Inside check_prev_add() > the stack_trace struct is checked for being empty, which is always > true. B

Re: [Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-19 Thread Peter Zijlstra
On Fri, Apr 19, 2019 at 10:32:30AM +0200, Thomas Gleixner wrote: > On Fri, 19 Apr 2019, Peter Zijlstra wrote: > > On Thu, Apr 18, 2019 at 10:41:47AM +0200, Thomas Gleixner wrote: > > > > > +typedef bool (*stack_trace_consume_fn)(void *co

Re: [Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-19 Thread Peter Zijlstra
On Thu, Apr 18, 2019 at 10:41:47AM +0200, Thomas Gleixner wrote: > +typedef bool (*stack_trace_consume_fn)(void *cookie, unsigned long addr, > + bool reliable); > +void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, > + st

Re: [Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-19 Thread Peter Zijlstra
On Thu, Apr 18, 2019 at 05:42:55PM +0200, Thomas Gleixner wrote: > On Thu, 18 Apr 2019, Josh Poimboeuf wrote: > > Another idea I had (but never got a chance to work on) was to extend the > > x86 unwind interface to all arches. So instead of the callbacks, each > > arch would implement something l

Re: [Intel-gfx] [PATCH 2/4] kernel.h: Add non_block_start/end()

2018-12-10 Thread Peter Zijlstra
On Mon, Dec 10, 2018 at 04:01:59PM +0100, Michal Hocko wrote: > On Mon 10-12-18 15:47:11, Peter Zijlstra wrote: > > On Mon, Dec 10, 2018 at 03:13:37PM +0100, Michal Hocko wrote: > > > I do not see any scheduler guys Cced and it would be really great to get > > > their op

Re: [Intel-gfx] [PATCH 2/4] kernel.h: Add non_block_start/end()

2018-12-10 Thread Peter Zijlstra
On Mon, Dec 10, 2018 at 05:20:10PM +0100, Michal Hocko wrote: > > OK, no real objections to the thing. Just so long we're all on the same > > page as to what it does and doesn't do ;-) > > I am not really sure whether there are other potential users besides > this one and whether the check as suc

Re: [Intel-gfx] [PATCH 2/4] kernel.h: Add non_block_start/end()

2018-12-10 Thread Peter Zijlstra
On Mon, Dec 10, 2018 at 03:13:37PM +0100, Michal Hocko wrote: > I do not see any scheduler guys Cced and it would be really great to get > their opinion here. > > On Mon 10-12-18 11:36:39, Daniel Vetter wrote: > > In some special cases we must not block, but there's not a > > spinlock, preempt-off

Re: [Intel-gfx] [PATCH 11/12] sched: use for_each_if in topology.h

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 05:52:04PM +0200, Daniel Vetter wrote: > for_each_something(foo) > if (foo->bla) > call_bla(foo); > else > call_default(foo); Note that the kernel coding style 'discourages' this style and would like you to write: for_each_so

Re: [Intel-gfx] [PATCH 11/12] sched: use for_each_if in topology.h

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 05:52:04PM +0200, Daniel Vetter wrote: > for_each_something(foo) > if (foo->bla) > call_bla(foo); > else > call_default(foo); > > Totally contrived, but this complains. Liberally sprinkling {} also shuts > up the compiler, but it's a

Re: [Intel-gfx] [PATCH 11/12] sched: use for_each_if in topology.h

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 05:00:07PM +0200, Daniel Vetter wrote: > On Mon, Jul 9, 2018 at 12:36 PM, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 10:36:49AM +0200, Daniel Vetter wrote: > >> #define for_each_node_with_cpus(node)\ > >>

Re: [Intel-gfx] [PATCH 11/12] sched: use for_each_if in topology.h

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 10:36:49AM +0200, Daniel Vetter wrote: > Avoids complaints from gcc about ambiguous else clauses. Is that a new thing? I'm fairly sure I've never seen it do that, > Signed-off-by: Daniel Vetter > Cc: Andrew Morton > Cc: Peter Zijlstra > --- &g

Re: [Intel-gfx] [PATCH 0/9] GPU-bound energy efficiency improvements for the intel_pstate driver.

2018-04-14 Thread Peter Zijlstra
On Fri, Apr 13, 2018 at 06:57:39PM -0700, Francisco Jerez wrote: > Peter Zijlstra writes: > > > On Thu, Apr 12, 2018 at 12:55:39PM -0700, Francisco Jerez wrote: > >> Actually assuming that a single geometric feature of the power curve is > >> known -- it being

Re: [Intel-gfx] [PATCH 0/9] GPU-bound energy efficiency improvements for the intel_pstate driver.

2018-04-13 Thread Peter Zijlstra
On Thu, Apr 12, 2018 at 12:55:39PM -0700, Francisco Jerez wrote: > Actually assuming that a single geometric feature of the power curve is > known -- it being convex in the frequency range allowed by the policy > (which is almost always the case, not only for Intel CPUs), the optimal > frequency fo

Re: [Intel-gfx] [PATCH 0/9] GPU-bound energy efficiency improvements for the intel_pstate driver.

2018-04-12 Thread Peter Zijlstra
On Thu, Apr 12, 2018 at 11:34:54AM -0700, Francisco Jerez wrote: > The reason for the energy efficiency problem of iowait boosting is > precisely the greater oscillation between turbo and idle. Say that > iowait boost increases the frequency by a factor alpha relative to the > optimal frequency f0

Re: [Intel-gfx] [PATCH 0/9] GPU-bound energy efficiency improvements for the intel_pstate driver.

2018-04-12 Thread Peter Zijlstra
On Wed, Apr 11, 2018 at 09:26:11AM -0700, Francisco Jerez wrote: > "just like" here is possibly somewhat unfair to the schedutil governor, > admittedly its progressive IOWAIT boosting behavior seems somewhat less > wasteful than the intel_pstate non-HWP governor's IOWAIT boosting > behavior, but it

  1   2   >