All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Merging v4.4.108 into I-Pipe, issue with switch_mm on x86
@ 2018-02-08  8:12 Sudler, Simon
  2018-02-08  8:22 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Sudler, Simon @ 2018-02-08  8:12 UTC (permalink / raw)
  To: xenomai; +Cc: Kiszka, Jan

Hi Guys,

I was just about to merging the v4.4.108 tag into the I-Pipe branch when I fall over these 4
commits from Andy Lutomirski:

git log --oneline dfe513a4e8ddde75ffc6abd3f139c5d65bf925d7..4ead44fd2525ed97e5362a806d312a0e3b0ea445
4ead44fd2525 x86/mm, sched/core: Turn off IRQs in switch_mm()
70a39c7fd167 x86/mm, sched/core: Uninline switch_mm()
83cc4b50e3a9 x86/mm: Build arch/x86/mm/tlb.c even on !SMP
425f13a36652 sched/core: Add switch_mm_irqs_off() and use it in the scheduler

He introduces a switch_mm_irqs_off function and turns IRQs of inside the switch_mm function. In
the switch_mm case local_irq_save/restore is to handle the interrupt flags.

In the I-Pipe case, the switch_mm functions was renamed to __switch_mm which then handels the
irq flags with hard_cond_local_irq_save/restore.

So my question is: Is this double saving and restoring of the flags useful in the I-Pipe case? Maybe
the the hard_cond_local_irq_save/restore can be moved to the local_irq_save/restore to have the
irq flag handling at one place.

With best regards,
Simon Sudler

--
Siemens AG, Process Industries and Drives Division, PD PA CI R&D 3
Process Automation


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Merging v4.4.108 into I-Pipe, issue with switch_mm on x86
  2018-02-08  8:12 [Xenomai] Merging v4.4.108 into I-Pipe, issue with switch_mm on x86 Sudler, Simon
@ 2018-02-08  8:22 ` Jan Kiszka
  2018-02-08  9:46   ` Sudler, Simon
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2018-02-08  8:22 UTC (permalink / raw)
  To: Sudler, Simon (PD PA CI R&D 3), xenomai

On 2018-02-08 09:12, Sudler, Simon (PD PA CI R&D 3) wrote:
> Hi Guys,
> 
> I was just about to merging the v4.4.108 tag into the I-Pipe branch when I fall over these 4
> commits from Andy Lutomirski:
> 
> git log --oneline dfe513a4e8ddde75ffc6abd3f139c5d65bf925d7..4ead44fd2525ed97e5362a806d312a0e3b0ea445
> 4ead44fd2525 x86/mm, sched/core: Turn off IRQs in switch_mm()
> 70a39c7fd167 x86/mm, sched/core: Uninline switch_mm()
> 83cc4b50e3a9 x86/mm: Build arch/x86/mm/tlb.c even on !SMP
> 425f13a36652 sched/core: Add switch_mm_irqs_off() and use it in the scheduler
> 
> He introduces a switch_mm_irqs_off function and turns IRQs of inside the switch_mm function. In
> the switch_mm case local_irq_save/restore is to handle the interrupt flags.
> 
> In the I-Pipe case, the switch_mm functions was renamed to __switch_mm which then handels the
> irq flags with hard_cond_local_irq_save/restore.
> 
> So my question is: Is this double saving and restoring of the flags useful in the I-Pipe case? Maybe
> the the hard_cond_local_irq_save/restore can be moved to the local_irq_save/restore to have the
> irq flag handling at one place.

Oops, when chatting with you, I totally forgot that I already did a 109
merge last month, just didn't find enough time to test. Now that you are
mentioning this concrete conflict, I started to remember. Please have a
look at
http://git.xenomai.org/ipipe-jki.git/log/?h=for-upstream/4.4-update.
That version /seems/ to work.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Merging v4.4.108 into I-Pipe, issue with switch_mm on x86
  2018-02-08  8:22 ` Jan Kiszka
@ 2018-02-08  9:46   ` Sudler, Simon
  2018-02-08 12:52     ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Sudler, Simon @ 2018-02-08  9:46 UTC (permalink / raw)
  To: xenomai, Kiszka, Jan

> Jan Kiszka wrote:
> 
> On 2018-02-08 09:12, Sudler, Simon (PD PA CI R&D 3) wrote:
> > Hi Guys,
> >
> > I was just about to merging the v4.4.108 tag into the I-Pipe branch when I fall over these 4
> > commits from Andy Lutomirski:
> >
> > git log --oneline dfe513a4e8ddde75ffc6abd3f139c5d65bf925d7..4ead44fd2525ed97e5362a806d312a0e3b0ea445
> > 4ead44fd2525 x86/mm, sched/core: Turn off IRQs in switch_mm()
> > 70a39c7fd167 x86/mm, sched/core: Uninline switch_mm()
> > 83cc4b50e3a9 x86/mm: Build arch/x86/mm/tlb.c even on !SMP
> > 425f13a36652 sched/core: Add switch_mm_irqs_off() and use it in the scheduler
> >
> > He introduces a switch_mm_irqs_off function and turns IRQs of inside the switch_mm function. In
> > the switch_mm case local_irq_save/restore is to handle the interrupt flags.
> >
> > In the I-Pipe case, the switch_mm functions was renamed to __switch_mm which then handels the
> > irq flags with hard_cond_local_irq_save/restore.
> >
> > So my question is: Is this double saving and restoring of the flags useful in the I-Pipe case? Maybe
> > the the hard_cond_local_irq_save/restore can be moved to the local_irq_save/restore to have the
> > irq flag handling at one place.
> 
> Oops, when chatting with you, I totally forgot that I already did a 109
> merge last month, just didn't find enough time to test. Now that you are
> mentioning this concrete conflict, I started to remember. Please have a
> look at
> http://git.xenomai.org/ipipe-jki.git/log/?h=for-upstream/4.4-update.
> That version /seems/ to work.

Okay, you added the "__" to the switch_mm_irqs_off. Wouldn't it be easier to just add

void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
			  struct task_struct *tsk)
{
#ifdef CONFIG_IPIPE
	unsigned long flags = hard_cond_local_irq_save();
#endif /* CONFIG_IPIPE */

	unsigned cpu = smp_processor_id();


to the mm/tlb.c and restore them at the end of the function? Then we could leaf the
mmc_context.h untouched.

Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Merging v4.4.108 into I-Pipe, issue with switch_mm on x86
  2018-02-08  9:46   ` Sudler, Simon
@ 2018-02-08 12:52     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2018-02-08 12:52 UTC (permalink / raw)
  To: Sudler, Simon (PD PA CI R&D 3), xenomai

On 2018-02-08 10:46, Sudler, Simon (PD PA CI R&D 3) wrote:
>> Jan Kiszka wrote:
>>
>> On 2018-02-08 09:12, Sudler, Simon (PD PA CI R&D 3) wrote:
>>> Hi Guys,
>>>
>>> I was just about to merging the v4.4.108 tag into the I-Pipe branch when I fall over these 4
>>> commits from Andy Lutomirski:
>>>
>>> git log --oneline dfe513a4e8ddde75ffc6abd3f139c5d65bf925d7..4ead44fd2525ed97e5362a806d312a0e3b0ea445
>>> 4ead44fd2525 x86/mm, sched/core: Turn off IRQs in switch_mm()
>>> 70a39c7fd167 x86/mm, sched/core: Uninline switch_mm()
>>> 83cc4b50e3a9 x86/mm: Build arch/x86/mm/tlb.c even on !SMP
>>> 425f13a36652 sched/core: Add switch_mm_irqs_off() and use it in the scheduler
>>>
>>> He introduces a switch_mm_irqs_off function and turns IRQs of inside the switch_mm function. In
>>> the switch_mm case local_irq_save/restore is to handle the interrupt flags.
>>>
>>> In the I-Pipe case, the switch_mm functions was renamed to __switch_mm which then handels the
>>> irq flags with hard_cond_local_irq_save/restore.
>>>
>>> So my question is: Is this double saving and restoring of the flags useful in the I-Pipe case? Maybe
>>> the the hard_cond_local_irq_save/restore can be moved to the local_irq_save/restore to have the
>>> irq flag handling at one place.
>>
>> Oops, when chatting with you, I totally forgot that I already did a 109
>> merge last month, just didn't find enough time to test. Now that you are
>> mentioning this concrete conflict, I started to remember. Please have a
>> look at
>> http://git.xenomai.org/ipipe-jki.git/log/?h=for-upstream/4.4-update.
>> That version /seems/ to work.
> 
> Okay, you added the "__" to the switch_mm_irqs_off. Wouldn't it be easier to just add
> 
> void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
> 			  struct task_struct *tsk)
> {
> #ifdef CONFIG_IPIPE
> 	unsigned long flags = hard_cond_local_irq_save();
> #endif /* CONFIG_IPIPE */
> 
> 	unsigned cpu = smp_processor_id();
> 
> 
> to the mm/tlb.c and restore them at the end of the function? Then we could leaf the
> mmc_context.h untouched.
> 

This could be done (btw, #ifdef is unneeded), but it would redundantly
disable/restore IRQs for all the callers of __switch_mm_irqs_off that
already have hard IRQs off (if you find one in my merge that have them
on, please let me know!).

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-08 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08  8:12 [Xenomai] Merging v4.4.108 into I-Pipe, issue with switch_mm on x86 Sudler, Simon
2018-02-08  8:22 ` Jan Kiszka
2018-02-08  9:46   ` Sudler, Simon
2018-02-08 12:52     ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.