Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5795966imm; Mon, 23 Jul 2018 06:17:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfPlLbg7Ir8jTBU8Wr+WhTmptHW5jMzMfNchaDGvMxjmHdKmOSEdfNt3Peny8QAGwKtUHZU X-Received: by 2002:a63:f18:: with SMTP id e24-v6mr12364479pgl.320.1532351864445; Mon, 23 Jul 2018 06:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532351864; cv=none; d=google.com; s=arc-20160816; b=PpxcCyVsA9B/452kr56OYO//Ei9oLgLMHw6ttBLovbkc/1GQDkS6A73cprYAYpKdsD rIrObpv8w2mKsby84S/dDMPfIEQizLF0wlEiHUz0mqLU4bECJtPdjY6OfX7mk+jrFhE/ yL5R9WmUlYBUT6vYPOQ6qGRPLG1b7XZBwdZvUiw35dOrVN658EUFmqW2wzZ4q7IPxYWD MRt0WLgP2rQ12iXBaScLvLTNI/ObLlEPhfdEM4+HWh48TmaKia7gHmPfbAnWnVLaWEcQ kdB9ppEydxgCcjm8hmCNTv7LqijbLZfXCYgzNz2+46eLM/MrO8XPypNTOmSyQ09dgaWv EeBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=3i3F5TAaACOMCVNH2cTpm97fode3kyi8ouwfgM2n9AY=; b=rAZJtq/BcKp104eVxB/IEp2CZKAS421bEnPxiX2bD0CE7nCw6DYEU3TSkr8riSxHtn 1y/aWnz21vaPbJSRKPq64wMuj7+9QSmsqxgo6hCrJlUnkC5T+xC+0w5PRmHPrraaKoS8 ymejjZgOBfmF9Djb1XCvGMC3PXh61FQ9nIPheTTpNBsHXiyzf6LzGwayGjB0Ki9ceyxc kmU5XjtlkJnLjgLKaXBNBp1I6++BHJffkRHpt2sRU1P0NJ1YkxRCgxComK7mUXGrAAnD q7uYJafbyuvrL0yZaPq4CAcitnl1LW0/0GNdt3u6mm/Qa1US05jLjTxq5GpJtcUNFkRC sIAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="dH3jcP/k"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h25-v6si8832819pgh.119.2018.07.23.06.17.29; Mon, 23 Jul 2018 06:17:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="dH3jcP/k"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388155AbeGWOQh (ORCPT + 99 others); Mon, 23 Jul 2018 10:16:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:48694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388119AbeGWOQh (ORCPT ); Mon, 23 Jul 2018 10:16:37 -0400 Received: from localhost (LFbn-NCY-1-241-207.w83-194.abo.wanadoo.fr [83.194.85.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25C8820854; Mon, 23 Jul 2018 13:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532351725; bh=Q+4sVVvqvsi9t0x3445fz5WFnYmmWue39NfOP809zO4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dH3jcP/k/z+HPUmD6nvs3Au3lqHm/0z2c9O1kzabnTlvZVzMNSFJNLNbRyDoM3kwN gW/Kcuknc7oMXLPTeHvQ0z2xkvOxJ79amagjFiWVaCHQKviuons4rmMWyxNree86F5 sAOkj022dTEII43DEUlIHL1866PlKICYypQX0IBg= Date: Mon, 23 Jul 2018 15:15:22 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: Yury Norov , Frederic Weisbecker , Ingo Molnar , "Goutham, Sunil" , Chris Metcalf , linux-kernel@vger.kernel.org Subject: Re: [PATCH] nohz: don't kick non-idle CPUs in tick_nohz_full_kick_cpu() Message-ID: <20180723131521.GB1383@lerouge> References: <20180712181922.23073-1-ynorov@caviumnetworks.com> <20180716153109.GA29270@lerouge> <20180719202200.GA17106@yury-thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 20, 2018 at 07:24:00PM +0200, Thomas Gleixner wrote: > On Thu, 19 Jul 2018, Yury Norov wrote: > > While here. I just wonder, on my system IRQs are sent to nohz_full CPUs > > at every incoming ssh connection. The trace is like this: > > [ 206.835533] Call trace: > > [ 206.848411] [] dump_stack+0x84/0xa8 > > [ 206.853455] [] _task_isolation_remote+0x130/0x140 > > [ 206.859714] [] irq_work_queue_on+0xcc/0xfc > > [ 206.865365] [] tick_nohz_full_kick_cpu+0x88/0x94 > > [ 206.871536] [] tick_nohz_dep_set_all+0x78/0xa8 > > [ 206.877533] [] tick_nohz_dep_set_signal+0x28/0x34 > > [ 206.883792] [] set_process_cpu_timer+0xd0/0x128 > > [ 206.889876] [] update_rlimit_cpu+0x58/0x7c > > [ 206.895528] [] selinux_bprm_committing_creds+0x180/0x1fc > > [ 206.902394] [] security_bprm_committing_creds+0x40/0x5c > > [ 206.909173] [] install_exec_creds+0x20/0x6c > > [ 206.914911] [] load_elf_binary+0x368/0xbb8 > > [ 206.920561] [] search_binary_handler+0xb8/0x224 > > [ 206.926645] [] do_execveat_common+0x44c/0x5f0 > > [ 206.932555] [] do_execve+0x38/0x44 > > [ 206.937510] [] SyS_execve+0x34/0x44 > > > > I suspect that scp, ssh tunneling and similar network activities will source > > ticks on nohz_full CPUs as well. On high-loaded server it may generate > > significant interrupt traffic on nohz_full CPUs. Is it desirable behavior? > > Supsicions and desirable are not really technical interesting aspects. > > Just from looking at the stack trace it's obvious that there is a CPU TIME > rlimit on that newly spawned sshd. That's nothing what the kernel > imposes. That's what user space sets. > > Now the actual mechanism which does that, i.e. set_process_cpu_timer() ends > up IPI'ing _ALL_ nohz full CPUs for no real good reason. In the exec path > this is really pointless because the new process is not running yet and it > is single threaded. So forcing a IPI to all cpus is pretty pointless. > > In fact the state of the task/process for which update_rlimit_cpu(() is > called is known, so the IPI can really be either avoided completely or > restricted to the CPUs on which this process can run or actually runs. > > Fredric? Indeed, so far the tick dependency code is lazy and IPIs everywhere when we add either a thread or a process timer. We want to make sure that any thread target, running somewhere without a tick, sees the new tick dependency. So in the case a single thread, I can easily fix that and IPI the CPU it's running in if any. In the case of a thread group, I'm concerned about the performance penalty to walk through each of them and IPI only those running. But probably we'll have to come into that in the end. Thanks.