From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0278FC43457 for ; Thu, 8 Oct 2020 18:05:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78F3020725 for ; Thu, 8 Oct 2020 18:05:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FX0/Z1jb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730866AbgJHSF3 (ORCPT ); Thu, 8 Oct 2020 14:05:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39490 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730626AbgJHSF1 (ORCPT ); Thu, 8 Oct 2020 14:05:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602180327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P2FMA6dYjcqdGcGBKsq85dw0RtnS7nDHyn2Pz4+p0sU=; b=FX0/Z1jbftoe+2+9+8/vAp0R+Awm+n5eoekOWD4kCGHIGZQliRE957i9wGioYAY3VBXoV4 a/lvXC3MB5+okJbky1+ULFD+DAVZLVf4xt2g9wB/3qoQ2proe1G0iRfhELdwLJrRqPvNp9 CBG/eTW9XAECs4A2hLgdOyEsM56PmL0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-ZvUmeQQIN1qnAIRfQsn5NA-1; Thu, 08 Oct 2020 14:05:23 -0400 X-MC-Unique: ZvUmeQQIN1qnAIRfQsn5NA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32BFF8064AB; Thu, 8 Oct 2020 18:05:22 +0000 (UTC) Received: from fuller.cnet (ovpn-112-7.gru2.redhat.com [10.97.112.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9527E5576D; Thu, 8 Oct 2020 18:05:16 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 23D23416C894; Thu, 8 Oct 2020 14:43:51 -0300 (-03) Date: Thu, 8 Oct 2020 14:43:51 -0300 From: Marcelo Tosatti To: Peter Xu Cc: linux-kernel@vger.kernel.org, Frederic Weisbecker , Peter Zijlstra , Nitesh Narayan Lal Subject: Re: [patch 1/2] nohz: only wakeup a single target cpu when kicking a task Message-ID: <20201008174351.GA14207@fuller.cnet> References: <20201007180151.623061463@redhat.com> <20201007180229.724302019@redhat.com> <20201008145940.GG6026@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201008145940.GG6026@xz-x1> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 10:59:40AM -0400, Peter Xu wrote: > On Wed, Oct 07, 2020 at 03:01:52PM -0300, Marcelo Tosatti wrote: > > +static void tick_nohz_kick_task(struct task_struct *tsk) > > +{ > > + int cpu = task_cpu(tsk); > > + > > + /* > > + * If the task concurrently migrates to another cpu, > > + * we guarantee it sees the new tick dependency upon > > + * schedule. > > + * > > + * > > + * set_task_cpu(p, cpu); > > + * STORE p->cpu = @cpu > > + * __schedule() (switch to task 'p') > > + * LOCK rq->lock > > + * smp_mb__after_spin_lock() STORE p->tick_dep_mask > > + * tick_nohz_task_switch() smp_mb() (atomic_fetch_or()) > > + * LOAD p->tick_dep_mask LOAD p->cpu > > + */ > > + > > + preempt_disable(); > > Pure question: is preempt_disable() required here? Same question to > tick_nohz_full_kick_all(). Hi Peter, Don't see why: irq_queue_work_on() disables preemption if necessary. > > > + if (cpu_online(cpu)) > > + tick_nohz_full_kick_cpu(cpu); > > + preempt_enable(); > > +} > > -- > Peter Xu