Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1970815imm; Fri, 7 Sep 2018 08:53:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ80y51eF0/gRm6gKFnqHguybB2utni3G7B3LV3NQezLKZBujt+UOTr9gtLkOTfIDQjMkG9 X-Received: by 2002:a63:495f:: with SMTP id y31-v6mr8802948pgk.32.1536335583886; Fri, 07 Sep 2018 08:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536335583; cv=none; d=google.com; s=arc-20160816; b=MR5hOCis/bZNIPFV1DHZ5Y6aI3S6YSaoY6/YyXwBpZkJ9yqX6ht+qsUJvSe5/i+Nte Dmi+e4QtUTPgiZ8nW0QzZbbNgxn9OcPjovR8xl99shxJJGPh8lva6pv2ICOzGCEVabAQ uqa0NnMrvVDFoQJHnHsuPsx76d0GQX7PmlNTjeqUHdRjPem+dlGi+uEC3z2QLMhTUho9 yfunp7Sxk7yWmt7Kx4g5EszikkNg1XCXChREtHq65kwSyQCyLfpp/s25gwqrhHYdrPf/ qI2nvwUPAFRY5MWfjlOo2PcwRmWwM9y27VzoY+GBYUeTWgZuWK85TAhsN1zZ2DkNtvgR ndKQ== 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; bh=/tt1x5V8vI/gV9w+n7YTsD4Ii6pVEeVAYF8srGCm1Oc=; b=CqDAZkfS/uXTd8Cyc2xjvOnj77lLFBANq3g1mD8YrKkd6PL+oVGtTuHEbsolJYt9e0 OW4kSj1V/XHmpKQd1AW2B1L0l/56AFFohORYMnpV4s6AFRukSwqkNZBYfgKNzU7mkpUb fomtMdPP2Dol2zoEomp0YwwvTSjgO7/ONBx4UsVdDwHgY03tO8I/qMFy+1M/9LPaZExq C2X7hnI/1nI4hwLLyMZEdwBR41AjP0o1ItAsMU01uY9G+mX9A1VXv1hJreKjCFEsce8f Lopa4O1l+3o31t0doow2C6bqZ0p12ei0gCZG3wXN/NBuFi/ZOr+4BCqBjQx57FIftRgH y90Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Ho1hogiw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7-v6si8661584pfk.356.2018.09.07.08.52.48; Fri, 07 Sep 2018 08:53:03 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Ho1hogiw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbeIGTkg (ORCPT + 99 others); Fri, 7 Sep 2018 15:40:36 -0400 Received: from merlin.infradead.org ([205.233.59.134]:56968 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727639AbeIGTkg (ORCPT ); Fri, 7 Sep 2018 15:40:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/tt1x5V8vI/gV9w+n7YTsD4Ii6pVEeVAYF8srGCm1Oc=; b=Ho1hogiwokgGgRwrhJZXjxLqe oZ+Tk8wKHohXPn1cBsAtN0HbfNBlF5/kl1VCEqqLPTsIGVX9/YqgXck2os+w52wTbaukUfIchAEr7 18LY7velP9yMnnMGONpht6/Ue5+C6IplKiJVcQZcPktE3JzceITt+yCHPsYEoBzj/8oFDpEBrF2R/ 7RdpufEjYTY088dr4POMSteThdYMHDkmSmvldcTLPAdWEcOt9Kq8IDAPHFKL35JatdeyGsT/t2j9z rHOz2cpI74Grds4Egz86OWAP9IYWNJ6ndrmCprt2GjKQUi107hVY2Lwkn0lGXqfRgGxIt/0DhygWo +T58MmvsQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyIDs-0006Df-0R; Fri, 07 Sep 2018 14:59:00 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9E9262024E440; Fri, 7 Sep 2018 16:58:58 +0200 (CEST) Date: Fri, 7 Sep 2018 16:58:58 +0200 From: Peter Zijlstra To: Johannes Weiner Cc: Ingo Molnar , Andrew Morton , Linus Torvalds , Tejun Heo , Suren Baghdasaryan , Daniel Drake , Vinayak Menon , Christopher Lameter , Peter Enderborg , Shakeel Butt , Mike Galbraith , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 8/9] psi: pressure stall information for CPU, memory, and IO Message-ID: <20180907145858.GK24106@hirez.programming.kicks-ass.net> References: <20180828172258.3185-1-hannes@cmpxchg.org> <20180828172258.3185-9-hannes@cmpxchg.org> <20180907101634.GO24106@hirez.programming.kicks-ass.net> <20180907144422.GA11088@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180907144422.GA11088@cmpxchg.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 07, 2018 at 10:44:22AM -0400, Johannes Weiner wrote: > > This does the whole seqcount thing 6x, which is a bit of a waste. > > [...] > > > It's a bit cumbersome, but that's because of C. > > I was actually debating exactly this with Suren before, but since this > is a super cold path I went with readability. I was also thinking that > restarts could happen quite regularly under heavy scheduler load, and > so keeping the individual retry sections small could be helpful - but > I didn't instrument this in any way. I was hoping going over the whole thing once would reduce the time we need to keep that line in shared mode and reduce traffic. And yes, this path is cold, but I was thinking about reducing the interference on the remote CPU. Alternatively, we memcpy the whole line under the seqlock and then do everything later. Also, this only has a single cpu_clock() invocation.