public inbox for linux-parisc@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Helge Deller <deller@gmx.de>
Cc: John David Anglin <dave.anglin@bell.net>,
	linux-parisc@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH] parisc: Optimize per-pagetable spinlocks (v11)
Date: Wed, 10 Feb 2021 06:52:18 -0800	[thread overview]
Message-ID: <20210210145218.GA50561@roeck-us.net> (raw)
In-Reply-To: <20210127211851.GA32689@ls3530.fritz.box>

On Wed, Jan 27, 2021 at 10:18:51PM +0100, Helge Deller wrote:
> On parisc a spinlock is stored in the next page behind the pgd which
> protects against parallel accesses to the pgd. That's why one additional
> page (PGD_ALLOC_ORDER) is allocated for the pgd.
> 
> Matthew Wilcox suggested that we instead should use a pointer in the
> struct page table for this spinlock and noted, that the comments for the
> PGD_ORDER and PMD_ORDER defines were wrong.
> 
> Both suggestions are addressed in this patch. The pgd spinlock
> (parisc_pgd_lock) is stored in the struct page table. In
> switch_mm_irqs_off() the physical address of this lock is loaded into
> cr28 (tr4) and the pgd into cr25, so that the fault handlers can
> directly access the lock.
> 
> The currently implemened Hybrid L2/L3 page table scheme (where the pmd
> is adjacent to the pgd) is dropped now too.
> 
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Fixes: b37d1c1898b2 ("parisc: Use per-pagetable spinlock")
> Signed-off-by: Helge Deller <deller@gmx.de>
> Signed-off-by: John David Anglin <dave.anglin@bell.net>

This patch results in:

BUG: spinlock recursion on CPU#0, swapper/0/1
 lock: 0x12226d14, .magic: dead4ead, .owner: swapper/0/1, .owner_cpu: 0
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.11.0-rc7-next-20210209-32bit #1
Hardware name: 9000/778/B160L
Backtrace:
 [<1019f9bc>] show_stack+0x34/0x48
 [<10a65278>] dump_stack+0x94/0x114
 [<10219f4c>] spin_dump+0x8c/0xb8
 [<1021a0b4>] do_raw_spin_lock+0xdc/0x108
 [<10a7367c>] _raw_spin_lock_irqsave+0x30/0x48
 [<102bf41c>] handle_mm_fault+0x5e8/0xdb0
 [<102b813c>] __get_user_pages.part.0+0x1b0/0x3d4
 [<102b8900>] __get_user_pages_remote+0x134/0x34c
 [<102b8b80>] get_user_pages_remote+0x68/0x90
 [<102fccb0>] get_arg_page+0x94/0xd8
 [<102fdd84>] copy_string_kernel+0xc4/0x234
 [<102fe70c>] kernel_execve+0xcc/0x1a4
 [<10a58d94>] run_init_process+0xbc/0xe0
 [<10a70d50>] kernel_init+0x98/0x13c
 [<1019a01c>] ret_from_kernel_thread+0x1c/0x24

when trying to boot parisc/hppa images in qemu. Reverting this patch fixes
the problem.

Bitsect log attached.

Guenter

---
# bad: [a4bfd8d46ac357c12529e4eebb6c89502b03ecc9] Add linux-next specific files for 20210209
# good: [92bf22614b21a2706f4993b278017e437f7785b3] Linux 5.11-rc7
git bisect start 'HEAD' 'v5.11-rc7'
# bad: [a8eb921ba7e8e77d994a1c6c69c8ef08456ecf53] Merge remote-tracking branch 'crypto/master'
git bisect bad a8eb921ba7e8e77d994a1c6c69c8ef08456ecf53
# bad: [b68df186dae8ae890df08059bb068b78252b053a] Merge remote-tracking branch 'hid/for-next'
git bisect bad b68df186dae8ae890df08059bb068b78252b053a
# good: [323c9f6fb99b033883b404ecbc811e7b283a60b3] Merge remote-tracking branch 'sunxi/sunxi/for-next'
git bisect good 323c9f6fb99b033883b404ecbc811e7b283a60b3
# bad: [9d40a7a579a5c51fad0d734a4ed39e39b858fca2] Merge remote-tracking branch 'btrfs/for-next'
git bisect bad 9d40a7a579a5c51fad0d734a4ed39e39b858fca2
# bad: [afe0c3efe88f6c295542fd336d5f604115e9184f] Merge remote-tracking branch 'powerpc/next'
git bisect bad afe0c3efe88f6c295542fd336d5f604115e9184f
# good: [c276186556ed2ce6d30da69ce275234a7df85b09] Merge remote-tracking branch 'mips/mips-next'
git bisect good c276186556ed2ce6d30da69ce275234a7df85b09
# good: [755d664174463791489dddf34c33308b61de68c3] powerpc: DebugException remove args
git bisect good 755d664174463791489dddf34c33308b61de68c3
# good: [26418b36a11f2eaf2556aa8cefe86132907e311f] powerpc/64s/radix: refactor TLB flush type selection
git bisect good 26418b36a11f2eaf2556aa8cefe86132907e311f
# bad: [d7bbb31642d2bd4aa5aad3595061a5e96c32d91d] Merge remote-tracking branch 'parisc-hd/for-next'
git bisect bad d7bbb31642d2bd4aa5aad3595061a5e96c32d91d
# good: [2261352157a932717ec08b9dd18d1bfbb7c37c52] Merge remote-tracking branch 'openrisc/or1k-5.11-fixes' into or1k-5.12-updates
git bisect good 2261352157a932717ec08b9dd18d1bfbb7c37c52
# good: [3c92b9eed3ae088ade3688fb356a90926c1c8ee4] Merge remote-tracking branch 'openrisc/for-next'
git bisect good 3c92b9eed3ae088ade3688fb356a90926c1c8ee4
# good: [accb4993d2ee6b644a3d01851cf2fb2c1e0813a6] parisc: Fix IVT checksum calculation wrt HPMC
git bisect good accb4993d2ee6b644a3d01851cf2fb2c1e0813a6
# bad: [4add5f175b1e4e71c06493f9a2c52490d2ea4365] parisc: Optimize per-pagetable spinlocks
git bisect bad 4add5f175b1e4e71c06493f9a2c52490d2ea4365
# good: [0d2d3836dd0a597e514e6231fbf2ae3944f5d38c] parisc: Bump 64-bit IRQ stack size to 64 KB
git bisect good 0d2d3836dd0a597e514e6231fbf2ae3944f5d38c
# first bad commit: [4add5f175b1e4e71c06493f9a2c52490d2ea4365] parisc: Optimize per-pagetable spinlocks

  parent reply	other threads:[~2021-02-10 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c696f95d-a5ba-1f73-fbe9-a5d3f25e79c0@bell.net>
     [not found] ` <2786b971-254a-ae07-ea24-38e57bd29892@bell.net>
     [not found]   ` <d4751664-6627-920e-9c44-7f9b7e287431@bell.net>
     [not found]     ` <6fb36e0e-62f5-68c7-92ec-c6dd16841813@bell.net>
     [not found]       ` <44ee7e09-90e7-0766-f0e4-bde2d3cdc2ec@bell.net>
     [not found]         ` <5100eb80-975f-d77d-846a-5aabc25d0f95@bell.net>
     [not found]           ` <e023991b-ba2e-f6da-94fb-0988ad70e717@bell.net>
     [not found]             ` <9b9c6446-365f-9ca6-b89f-c330fca11952@bell.net>
     [not found]               ` <94210da5-5642-82ef-85ae-688e1c07473d@gmx.de>
     [not found]                 ` <4f76001d-f050-286f-4b6f-790554583eea@bell.net>
2021-01-27 21:18                   ` [PATCH] parisc: Optimize per-pagetable spinlocks (v11) Helge Deller
2021-01-28  8:36                     ` Rolf Eike Beer
2021-01-28 15:24                       ` [PATCH] parisc: Optimize per-pagetable spinlocks (v12) Helge Deller
2021-02-10 14:52                     ` Guenter Roeck [this message]
2021-02-10 17:23                       ` [PATCH] parisc: Optimize per-pagetable spinlocks (v11) Helge Deller
2021-02-10 18:57                         ` John David Anglin
2021-02-11  1:20                           ` Guenter Roeck
2021-02-11 14:38                             ` John David Anglin
2021-02-11 21:51                               ` Guenter Roeck
2021-02-11 22:16                                 ` John David Anglin
2021-02-11 23:12                                   ` Guenter Roeck
2021-02-11 23:14                                   ` Helge Deller
2021-02-11 23:22                                     ` Helge Deller
2021-02-11 23:23                                     ` John David Anglin
2021-02-11 23:34                                     ` John David Anglin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210210145218.GA50561@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox