From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Bristot de Oliveira Subject: Re: [PATCH 2/2] rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration Date: Mon, 26 Jun 2017 14:16:10 +0200 Message-ID: References: <20170622083830.5thlni7wy6ggdbh5@gmail.com> <5c90773d-1283-d3de-4282-e3855331d4e4@redhat.com> <20170622194943.ho4yekdqqeg2qiva@gmail.com> <20170624064157.tc7xogi4aa5t7maf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-rt-users , "Luis Claudio R . Goncalves" , Clark Williams , Luiz Capitulino , Sebastian Andrzej Siewior , Thomas Gleixner , Steven Rostedt , Peter Zijlstra , LKML To: Ingo Molnar Return-path: Received: from mail-qt0-f180.google.com ([209.85.216.180]:35105 "EHLO mail-qt0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbdFZMQP (ORCPT ); Mon, 26 Jun 2017 08:16:15 -0400 Received: by mail-qt0-f180.google.com with SMTP id f92so73013399qtb.2 for ; Mon, 26 Jun 2017 05:16:15 -0700 (PDT) In-Reply-To: <20170624064157.tc7xogi4aa5t7maf@gmail.com> Content-Language: en-US Sender: linux-rt-users-owner@vger.kernel.org List-ID: On 06/24/2017 08:41 AM, Ingo Molnar wrote: >> +enum inc_dec_migratory { >> + DEC_NR_MIGRATORY = -1, >> + INC_NR_MIGRATORY = 1, >> +}; >> + >> +static inline void >> +inc_dec_nr_migratory(struct task_struct *p, enum inc_dec_migratory id) >> +{ >> + if (unlikely((p->sched_class == &rt_sched_class || >> + p->sched_class == &dl_sched_class) && >> + p->nr_cpus_allowed > 1)) { >> + if (p->sched_class == &rt_sched_class) >> + task_rq(p)->rt.rt_nr_migratory += id; >> + else >> + task_rq(p)->dl.dl_nr_migratory += id; >> + } >> +} > How about just 'long delta', pass in +1 or -1 and do away with the > inc_dec_migratory complication? Ack! I am cooking a v2 using a long delta, rather than the inc_dec_migratory complication (yeah, I exaggerated hehe). Thanks! -- Daniel