public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: jamie@shareable•org (Jamie Lokier)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] [ARM] Do not call flush_cache_user_range with mmap_semheld
Date: Thu, 6 May 2010 17:07:52 +0100	[thread overview]
Message-ID: <20100506160752.GE28512@shareable.org> (raw)
In-Reply-To: <20100506160153.GD28512@shareable.org>

Jamie Lokier wrote:
> Catalin Marinas wrote:
> > The flush_cache_user_range operation cannot actually damage the data. If
> > the application is so badly written that one of its threads remaps a
> > page range while another thread writes to it and flushes the caches,
> > then it deserves the memory corruption.
> 
> It may deserve corruption, but doing corruption silently is cruel.
> 
> Moreover, calling mprotect(PROT_READ) in one thread while another
> thread is writing to the same regions is a valid, and used, garbage
> collector dirty-tracking technique.  (Page faults provide the info,
> and the fault handler uses PROT_WRITE to let the faulting thread
> continue on each tracked page.)
> 
> Is it possible to percolate EFAULT to the right places when the cache
> flush faults?

Scratch that idea.  How about just doing a full mm
(address-independent) cache flush if a fault occurs?

Performance doesn't matter (it's not a normal situation), and it's
better than corruption (no week-long debugging session surprise).

-- Jamie

  reply	other threads:[~2010-05-06 16:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28  7:32 [PATCH] [ARM] Do not call flush_cache_user_range with mmap_sem held Dima Zavin
2010-04-28  7:35 ` Dima Zavin
2010-04-29 13:00 ` Russell King - ARM Linux
2010-04-29 18:16   ` Jamie Lokier
2010-04-29 18:24     ` Russell King - ARM Linux
2010-04-29 19:23       ` Dima Zavin
2010-05-04  4:07         ` Dima Zavin
2010-05-04  7:40           ` Russell King - ARM Linux
2010-05-06 15:00       ` [PATCH] [ARM] Do not call flush_cache_user_range with mmap_semheld Catalin Marinas
2010-05-06 16:01         ` Jamie Lokier
2010-05-06 16:07           ` Jamie Lokier [this message]
2010-05-06 16:24             ` Catalin Marinas
2010-05-06 16:21           ` Catalin Marinas
2010-05-06 15:08 ` [PATCH] [ARM] Do not call flush_cache_user_range with mmap_sem held Catalin Marinas

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=20100506160752.GE28512@shareable.org \
    --to=jamie@shareable$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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