Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757630AbbFQF7X (ORCPT ); Wed, 17 Jun 2015 01:59:23 -0400 Received: from e19.ny.us.ibm.com ([129.33.205.209]:52981 "EHLO e19.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754220AbbFQF7O (ORCPT ); Wed, 17 Jun 2015 01:59:14 -0400 X-Helo: d01dlp03.pok.ibm.com X-MailFrom: preeti@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Message-ID: <55810CAA.6010208@linux.vnet.ibm.com> Date: Wed, 17 Jun 2015 11:29:06 +0530 From: Preeti U Murthy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Rik van Riel , Frederic Weisbecker , LKML CC: Peter Zijlstra , Thomas Gleixner , Christoph Lameter , Ingo Molnar , Viresh Kumar Subject: Re: [PATCH 7/8] nohz: Evaluate tick dependency once on context switch References: <1434044168-23173-1-git-send-email-fweisbec@gmail.com> <1434044168-23173-8-git-send-email-fweisbec@gmail.com> <5579F3A5.7010103@redhat.com> In-Reply-To: <5579F3A5.7010103@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061705-0057-0000-0000-00000079D2CE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2028 Lines: 51 On 06/12/2015 02:16 AM, Rik van Riel wrote: > On 06/11/2015 01:36 PM, Frederic Weisbecker wrote: >> The tick dependency is evaluated on every irq. This is a batch of checks >> which determine whether it is safe to stop the tick or not. These checks >> are often split in many details: posix cpu timers, scheduler, sched clock, >> perf events. Each of which are made of smaller details: posix cpu >> timer involves checking process wide timers then thread wide timers. Perf >> involves checking freq events then more per cpu details. >> >> Checking these details every time we update the full dynticks state >> bring avoidable overhead. >> >> So lets evaluate these dependencies once on context switch. Then the >> further dependency checks will be performed through a single state check. >> >> This is a first step that can be later optimized by dividing task level >> dependency, CPU level dependency and global dependency and update >> each at the right time. > >> +static void tick_nohz_full_update_dependencies(void) >> +{ >> + struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); >> + >> + if (!posix_cpu_timers_can_stop_tick(current)) >> + ts->tick_needed |= TICK_NEEDED_POSIX_CPU_TIMER; >> + >> + if (!perf_event_can_stop_tick()) >> + ts->tick_needed |= TICK_NEEDED_PERF_EVENT; >> + >> + if (!sched_can_stop_tick()) >> + ts->tick_needed |= TICK_NEEDED_SCHED; >> > > I see this getting kicked from task work and from ipi > context, but does it get kicked on task wakeup, when > we have a second runnable task on a CPU, but we decide > not to preempt the currently running task to switch to > it yet, but we will want to preempt the currently running > task at a later point in time? +1. This is not taken care of as far as I can see too. Regards Preeti U Murthy > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/