From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbdFZMQT (ORCPT ); Mon, 26 Jun 2017 08:16:19 -0400 Received: from mail-qt0-f180.google.com ([209.85.216.180]:34653 "EHLO mail-qt0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbdFZMQP (ORCPT ); Mon, 26 Jun 2017 08:16:15 -0400 Subject: Re: [PATCH 2/2] rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration To: Ingo Molnar Cc: linux-rt-users , "Luis Claudio R . Goncalves" , Clark Williams , Luiz Capitulino , Sebastian Andrzej Siewior , Thomas Gleixner , Steven Rostedt , Peter Zijlstra , LKML References: <20170622083830.5thlni7wy6ggdbh5@gmail.com> <5c90773d-1283-d3de-4282-e3855331d4e4@redhat.com> <20170622194943.ho4yekdqqeg2qiva@gmail.com> <20170624064157.tc7xogi4aa5t7maf@gmail.com> From: Daniel Bristot de Oliveira Message-ID: Date: Mon, 26 Jun 2017 14:16:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170624064157.tc7xogi4aa5t7maf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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