linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Autran <gautran@mrv.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-ppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: [PATCH] 8xx: get_mmu_context() for (very) FEW_CONTEXTS and	KERNEL_PREEMPT race/starvation issue
Date: Thu, 30 Jun 2005 09:54:00 -0400	[thread overview]
Message-ID: <42C3F978.2070305@mrv.com> (raw)
In-Reply-To: <20050629193846.GA4748@logos.cnet>

[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]

Well, disabling preemption in the get_mmu_context() does not help much...
I'm trying to disable preemption only inside destroy_mmu_context() as 
suggested.
Will keep you posted.

Guillaume.



Marcelo Tosatti wrote:

>On Thu, Jun 30, 2005 at 09:26:07AM +1000, Benjamin Herrenschmidt wrote:
>  
>
>>>Execution is resumed exactly where it has been interrupted.
>>>
>>>      
>>>
>>>>The idea behind my patch was to get rid of that nr_free_contexts counter 
>>>>that is (I thing) redundant with the context_map.
>>>>        
>>>>
>>>Apparently its there to avoid the spinlock exactly on !FEW_CONTEXTS machines.
>>>
>>>I suppose that what happens is that get_mmu_context() gets preempted after stealing
>>>a context (so nr_free_contexts = 0), but before setting next_mmu_context to the 
>>>next entry
>>>
>>>next_mmu_context = (ctx + 1) & LAST_CONTEXT;
>>>      
>>>
>>Ugh ? Can switch_mm() be preempted at all ? Did I miss yet another
>>"let's open 10 gazillion races for gun" Ingo patch ?
>>    
>>
>
>Doh nope it can't - my bad.
>
>  
>
>>>So if the now running higher prio tasks calls switch_mm() (which is likely to happen)
>>>it loops forever on atomic_dec_if_positive(&nr_free_contexts), while steal_context()
>>>sees "mm->context == CONTEXT".
>>>      
>>>
>>I think the race is only when destroy_context() is preempted, but maybe
>>I missed something.
>>    
>>
>
>Nope, I think you are right. My "theory" is obviously flawed now. 
>
>There seem to be several contexts where destroy_context() could be called
>with preempt enabled - I should have been shutup in the first place :)
>
>Lets wait for Guillaume to test...
>
>  
>

-- 
=======================================
Guillaume Autran
Senior Software Engineer
MRV Communications, Inc.
Tel: (978) 952-4932 office
E-mail: gautran@mrv.com
======================================= 


[-- Attachment #2: Type: text/html, Size: 2658 bytes --]

  reply	other threads:[~2005-06-30 13:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-25 14:53 [PATCH] 8xx: map_page() skip pinned region and tlbie debugging aid Marcelo Tosatti
2005-06-25 22:24 ` Dan Malek
2005-06-26 14:30   ` Marcelo Tosatti
2005-06-27 13:39     ` Marcelo Tosatti
2005-06-27 20:46       ` Dan Malek
2005-06-28  6:30         ` Benjamin Herrenschmidt
2005-06-28 13:42           ` [PATCH] 8xx: get_mmu_context() for (very) FEW_CONTEXTS and KERNEL_PREEMPT race/starvation issue Guillaume Autran
2005-06-29  4:15             ` Benjamin Herrenschmidt
2005-06-29 15:32               ` Guillaume Autran
2005-06-29 15:54                 ` Marcelo Tosatti
2005-06-29 21:25                   ` Guillaume Autran
2005-06-29 17:00                     ` Marcelo Tosatti
2005-06-29 23:26                   ` Benjamin Herrenschmidt
2005-06-29 19:38                     ` Marcelo Tosatti
2005-06-30 13:54                       ` Guillaume Autran [this message]
2005-07-05 13:12                         ` Guillaume Autran
2005-06-30  0:34                     ` Eugene Surovegin
2005-06-29 23:24                 ` Benjamin Herrenschmidt
2005-06-28 13:53           ` [PATCH] 8xx: map_page() skip pinned region and tlbie debugging aid Dan Malek
2005-06-28 23:47             ` Benjamin Herrenschmidt
2005-06-29 17:19             ` Marcelo Tosatti
2005-06-29 23:31               ` Benjamin Herrenschmidt
2005-06-30 18:05                 ` Dan Malek
2005-06-30 23:29                   ` Benjamin Herrenschmidt
2005-07-01  7:01                     ` Pantelis Antoniou
2005-06-30 17:49               ` Dan Malek
2005-06-27 14:28   ` [PATCH] 8xx: tlbie debugging aid (try #2) Marcelo Tosatti
2005-06-27 20:18     ` Dan Malek
2005-06-27 14:56       ` Marcelo Tosatti
2005-06-27 20:53         ` Dan Malek

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=42C3F978.2070305@mrv.com \
    --to=gautran@mrv.com \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=marcelo.tosatti@cyclades.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;
as well as URLs for NNTP newsgroup(s).