From: Helge Deller <deller@gmx.de>
To: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Cc: John David Anglin <dave@hiauly1.hia.nrc.ca>,
NIIBE Yutaka <gniibe@fsij.org>,
linux-parisc@vger.kernel.org,
pkg-gauche-devel@lists.alioth.debian.org, 561203@bugs.debian.org
Subject: Re: threads and fork on machine with VIPT-WB cache
Date: Thu, 08 Apr 2010 23:11:41 +0200 [thread overview]
Message-ID: <4BBE468D.5060609@gmx.de> (raw)
In-Reply-To: <20100402193514.GA9860@hiauly1.hia.nrc.ca>
On 04/02/2010 09:35 PM, John David Anglin wrote:
> On Fri, 02 Apr 2010, NIIBE Yutaka wrote:
>
>> NIIBE Yutaka wrote:
>>> To have same semantics as other archs, I think that VIPT-WB cache
>>> machine should have cache flush at ptep_set_wrprotect, so that memory
>>> of the page has up-to-date data. Yes, it will be huge performance
>>> impact for fork. But I don't find any good solution other than this
>>> yet.
>>
>> I think we could do something like (only for VIPT-WB cache machine):
>>
>> - static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long
>> address, pte_t *ptep)
>>
>> + static inline void ptep_set_wrprotect(struct vm_area_struct *vma, struct
>> mm_struct *mm, unsigned long addr, pte_t *ptep)
>> {
>> pte_t old_pte = *ptep;
>> + if (atomic_read(&mm->mm_users) > 1)
>> + flush_cache_page(vma, addr, pte_pfn(old_pte));
>> set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
>> }
>
> I tested the hack below on two machines currently running 2.6.33.2
> UP kernels. The change seems to fix Debian #561203 (minifail bug)!
> Thus, I definitely think you are on the right track. I'll continue
> to test.
>
> I suspect the same issue is present for SMP kernels.
Hi Dave,
I tested your patch today on one of my machines with plain kernel 2.6.33 (32bit, SMP, B2000 I think).
Sadly I still did see the minifail bug.
Are you sure, that the patch fixed this bug for you?
Helge
do_page_fault() pid=21470 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=7986 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=19952 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=13549 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=21862 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=4615 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=17336 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=21986 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=2157 command='minifail3' type=15 address=0x000000dc
do_page_fault() pid=23886 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=2681 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=3229 command='minifail3' type=15 address=0x000000ec
do_page_fault() pid=26095 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=20722 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=19912 command='minifail3' type=15 address=0x000000ec
...
pagealloc: memory corruption
7db0c780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
7db0c790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
7db0c7a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
7db0c7b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Backtrace:
[<1011ec14>] show_stack+0x18/0x28
[<10117ba0>] dump_stack+0x1c/0x2c
[<101c6594>] kernel_map_pages+0x2a0/0x2b8
[<1019e6c8>] get_page_from_freelist+0x3d4/0x614
[<1019ea3c>] __alloc_pages_nodemask+0x134/0x610
[<101b1d20>] do_wp_page+0x268/0xac0
[<101b3b34>] handle_mm_fault+0x4d4/0x7c4
[<1011d854>] do_page_fault+0x1f8/0x2fc
[<1011f450>] handle_interruption+0xec/0x730
[<10103078>] intr_check_sig+0x0/0x34
...
do_page_fault() pid=13414 command='minifail3' type=15 address=0x000000dc
do_page_fault() pid=22776 command='minifail3' type=15 address=0x00000000
do_page_fault() pid=26290 command='minifail3' type=15 address=0x000000ec
do_page_fault() pid=1399 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=16130 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=26401 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=3383 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=3400 command='minifail3' type=15 address=0x00000004
do_page_fault() pid=18659 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=3730 command='minifail3' type=6 address=0x00000003
do_page_fault() pid=28828 command='minifail3' type=6 address=0x00000003
next prev parent reply other threads:[~2010-04-08 21:11 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4BA43CE5.4020807@fsij.org>
[not found] ` <87hbo4ek8l.fsf@thialfi.karme.de>
[not found] ` <4BB18B46.2070203@fsij.org>
[not found] ` <4BB53D26.60601@fsij.org>
2010-04-02 2:41 ` threads and fork on machine with VIPT-WB cache NIIBE Yutaka
2010-04-02 3:30 ` James Bottomley
2010-04-02 3:48 ` NIIBE Yutaka
2010-04-02 8:05 ` NIIBE Yutaka
2010-04-02 19:35 ` John David Anglin
2010-04-08 21:11 ` Helge Deller [this message]
2010-04-08 21:54 ` John David Anglin
2010-04-08 22:44 ` John David Anglin
2010-04-09 14:14 ` Carlos O'Donell
2010-04-09 15:13 ` John David Anglin
2010-04-09 15:48 ` James Bottomley
2010-04-09 16:22 ` John David Anglin
2010-04-09 16:31 ` James Bottomley
2010-04-10 20:46 ` Helge Deller
2010-04-10 21:56 ` John David Anglin
2010-04-10 22:53 ` John David Anglin
2010-04-11 18:50 ` Helge Deller
2010-04-11 22:25 ` John David Anglin
2010-04-12 21:02 ` Helge Deller
2010-04-12 21:41 ` John David Anglin
2010-04-13 11:55 ` Helge Deller
2010-04-13 14:03 ` John David Anglin
2010-04-15 22:35 ` John David Anglin
2010-04-19 16:26 ` John David Anglin
2010-04-20 17:59 ` Helge Deller
2010-04-20 18:52 ` John David Anglin
2010-05-09 12:43 ` John David Anglin
2010-05-09 14:14 ` Carlos O'Donell
2010-05-10 9:56 ` Helge Deller
2010-05-10 14:56 ` John David Anglin
2010-05-10 19:20 ` Helge Deller
2010-05-10 21:07 ` John David Anglin
2010-05-11 16:37 ` John David Anglin
2010-05-11 21:39 ` John David Anglin
2010-05-11 20:44 ` Helge Deller
2010-05-11 20:41 ` Helge Deller
2010-05-11 21:26 ` John David Anglin
2010-05-11 21:41 ` Helge Deller
2010-05-15 21:02 ` John David Anglin
2010-05-16 20:22 ` Helge Deller
2010-05-16 21:38 ` John David Anglin
2010-05-22 17:25 ` John David Anglin
2010-05-23 13:11 ` Carlos O'Donell
2010-05-23 14:43 ` John David Anglin
2010-05-01 18:34 ` Thibaut VARENE
2010-05-01 20:17 ` John David Anglin
2010-05-02 10:53 ` Thibaut VARÈNE
2010-04-11 16:36 ` [PATCH] Call pagefault_disable/pagefault_enable in kmap_atomic/kunmap_atomic John David Anglin
2010-04-11 17:03 ` [PATCH] Remove unnecessary macros from entry.S John David Anglin
2010-04-11 17:08 ` [PATCH] Delete unnecessary nop's in entry.S John David Anglin
2010-04-11 17:12 ` [PATCH] Avoid interruption in critical region " John David Anglin
2010-04-11 18:24 ` James Bottomley
2010-04-11 18:45 ` John David Anglin
2010-04-11 18:53 ` James Bottomley
2010-04-11 17:26 ` [PATCH] LWS fixes for syscall.S John David Anglin
2010-06-02 15:33 ` Bug#561203: threads and fork on machine with VIPT-WB cache Modestas Vainius
2010-06-02 17:16 ` John David Anglin
2010-06-02 17:56 ` Bug#561203: " dann frazier
2010-06-03 8:50 ` Modestas Vainius
2010-06-04 1:03 ` NIIBE Yutaka
2010-06-04 5:21 ` dann frazier
2010-06-04 10:44 ` Thibaut VARENE
2010-06-07 17:11 ` dann frazier
2010-06-07 18:27 ` Thibaut VARÈNE
2010-06-07 23:33 ` dann frazier
2010-06-06 1:01 ` Modestas Vainius
2010-04-02 12:22 ` James Bottomley
2010-04-05 0:39 ` NIIBE Yutaka
2010-04-05 2:51 ` John David Anglin
2010-04-05 2:58 ` John David Anglin
2010-04-05 16:18 ` James Bottomley
2010-04-06 4:57 ` NIIBE Yutaka
2010-04-06 13:37 ` James Bottomley
2010-04-06 13:44 ` James Bottomley
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=4BBE468D.5060609@gmx.de \
--to=deller@gmx.de \
--cc=561203@bugs.debian.org \
--cc=dave.anglin@nrc-cnrc.gc.ca \
--cc=dave@hiauly1.hia.nrc.ca \
--cc=gniibe@fsij.org \
--cc=linux-parisc@vger.kernel.org \
--cc=pkg-gauche-devel@lists.alioth.debian.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