Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> On archs with non-atomic switch_mm(), use_mm() will require a different
>> strategy. I'm thinking about something like
>>
>> use_mm():
>>      set_some_flag();
>>      barrier();
>>      current->mm = new_mm;
>>      current->active_mm = new_mm;
>>      switch_mm(old_active_mm, new_mm, current);
>>      clear_some_flag();
>>
>> and switch_mm():
>>      ...
>>      if (likely(prev != next) || some_flag_set()) {
>>              clear_some_flag();
>>              ...
>>
>> ie. enforce mm switch if we may have interrupted use_mm at an unpleasant
>> time. I just don't know yet where to attach that some_flag to. Should be
>> the current task, but can we always access it from switch_mm?
> 
> These mechanisms are already in place. All you have to do is:
> 
> use_mm()
>       ipipe_active_mm = NULL;
>       barrier();
>       current->mm = new_mm;
>       current->active_mm = new_mm;
>       switch_mm(old_active_mm, new_mm, current);
> 

As far as I understand, ipipe_active_mm has different semantics on ARM.
Specifically, it has no relation to the initial "next != prev" check.
The test we need is likely orthogonal to this.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to