Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: "Kevin D. Kissell" <kevink@paralogos.com>,
	linux-mips@linux-mips.org,
	Maksim Rayskiy <maksim.rayskiy@gmail.com>,
	Sergey Shtylyov <sshtylyov@mvista.com>
Subject: Re: [PATCH RESEND 1/9] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu
Date: Wed, 9 Nov 2011 13:11:47 +0000	[thread overview]
Message-ID: <20111109131147.GB1586@linux-mips.org> (raw)
In-Reply-To: <CAJiQ=7B0Kcd4FnCtFedHqj_69U7Rt2fw4hwmx5WCh5sZZBXSow@mail.gmail.com>

On Tue, Nov 08, 2011 at 09:33:52PM -0800, Kevin Cernekee wrote:

> I read through mmu_context.h and the threads from November/December
> 2010 a couple of times, and I'm starting to think Maksim's original
> approach (don't reset asid_cache(cpu) when warm-restarting a CPU)
> makes the most sense.
> 
> The basic issue is that we want to assign unique, strictly increasing
> values to each mm's cpu_context(cpu, mm).  The per-cpu counter starts
> at ASID_FIRST_VERSION (0x100 on R4K), and counts up.  Assigning a new
> mm the same ASID value as an existing mm on the same CPU is illegal.
> Two obvious ways to meet this requirement when hotplugging CPUs are:
> 
> Option #1: Retain the asid_cache(cpu) value across warm restarts.
> This is simple and inexpensive.  We pick up where we left off, and
> whatever existing cpu_context(cpu, mm) values are out there do not
> cause any trouble.
> 
> I believe Maksim's original logic (assign ASID_FIRST_VERSION, a
> nonzero number, if asid_cache(cpu) == 0) would work correctly as
> written, because cpu_data is an array in .bss .  It will be 0 until
> the CPU is booted, and get_new_mmu_context() ensures that it will
> never be 0 again after that.
> 
> Kevin K brought up the idea of a warm restart bitmask so the code
> could tell whether asid_cache(cpu) was valid.  I'm not sure that this
> would be required.

Neither do I.

> I think we can also get away with not explicitly preserving EntryHi,
> since switch_mm() and activate_mm() will set it anyway.
> 
> Option #2: When warm restarting a CPU, set asid_cache(cpu) to
> ASID_FIRST_VERSION again.  And at some point (cpu_up or cpu_down),
> iterate through all processes to set cpu_context(cpu, mm) to something
> that will not conflict with a newly assigned ASID.  This is what the
> most recent patch did.  It gets the job done, but it's more work than
> what is really needed.
> 
> Please let me know your thoughts...

I still like the original patch https://patchwork.linux-mips.org/patch/1797/
I'd apply it right away but I'm going to hold off for a day just to give
Kevin and maybe others a chance to comment.

  Ralf

      reply	other threads:[~2011-11-09 13:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05 21:21 [PATCH RESEND 1/9] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu Kevin Cernekee
2011-11-05 21:21 ` [PATCH 2/9] MIPS: BMIPS: Fix up Kconfig settings Kevin Cernekee
2011-11-05 21:21 ` [PATCH 3/9] MIPS: BMIPS: Add XKS01 feature flag to Kconfig Kevin Cernekee
2011-11-08 15:49   ` Ralf Baechle
2011-11-05 21:21 ` [PATCH 4/9] MIPS: Clean up whitespace warning in hazards.h Kevin Cernekee
2011-11-05 21:21 ` [PATCH 5/9] MIPS: BMIPS: Add CFLAGS, Makefile entries for BMIPS Kevin Cernekee
2011-11-05 21:21 ` [PATCH 6/9] MIPS: BMIPS: Add set/clear CP0 macros for BMIPS operations Kevin Cernekee
2011-11-05 21:21 ` [PATCH 7/9] MIPS: BMIPS: Introduce bmips.h Kevin Cernekee
2011-11-08 15:03   ` Ralf Baechle
2011-11-05 21:21 ` [PATCH 8/9] MIPS: Add board_* hooks for ebase and NMI Kevin Cernekee
2011-11-08 15:23   ` Ralf Baechle
2011-11-05 21:21 ` [PATCH 9/9] MIPS: BMIPS: Add SMP support code for BMIPS43xx/BMIPS5000 Kevin Cernekee
2011-11-08 15:56   ` Ralf Baechle
2011-11-08 16:47 ` [PATCH RESEND 1/9] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu Ralf Baechle
2011-11-08 19:40   ` Kevin Cernekee
2011-11-09  5:33   ` Kevin Cernekee
2011-11-09 13:11     ` Ralf Baechle [this message]

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=20111109131147.GB1586@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=cernekee@gmail.com \
    --cc=kevink@paralogos.com \
    --cc=linux-mips@linux-mips.org \
    --cc=maksim.rayskiy@gmail.com \
    --cc=sshtylyov@mvista.com \
    /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