Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3642816imu; Sun, 11 Nov 2018 20:17:42 -0800 (PST) X-Google-Smtp-Source: AJdET5dBxTztpFHJSb5hZRuER06B88epr8+1a/6XZSdktCIdT0mcnSWKc7Ruzg0mHgVmXJSAuNII X-Received: by 2002:a17:902:8486:: with SMTP id c6-v6mr17953062plo.119.1541996262112; Sun, 11 Nov 2018 20:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541996262; cv=none; d=google.com; s=arc-20160816; b=XxBJkK+ijQZMLsSP0TIX6ktnGvU51HBwP0wSrj7TfJX8rgTrdFvl3//E1FbAo1Zna9 5hhO34OIodRHQg2UwU6fED5m5f3AvhOu9mN1pVgNxcR7m8E2suMrzKKE3/SENWZ2+3z+ 3JItoX8wwmpnqNn/834xCYi4tpvE6zO0dAo6A9txVLy9Klxkd7kn7x8mqBkqN1uLtiF5 xbWqgsW/I0UC5VsMN3OhTw+dDasFKkNXwhob58wWpA5aN7CXEonkiUsny9XLONVhT3IH FR0zfr5wP0/ITRBiTiS8UwlEzJbD9/gvHq6uLJGoAzzXYUXg8HB++hnaSsrveEnWXq42 SKdg== 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=lLJXrIqYM8TU/W6Zal1zkWGH1kuS9Sn6oelDMQ/ByZ0=; b=Mv7wcu+c2v1wpg0tTrEFyA/hSfnO0Mmy5eekWXh96lOkuRbx7bLwNebSX3pyTDqWvP Ha2p8z+6Z6+tjepXQ6qr1BjmOC/oPdCza6+l8LYDxL8iHyzNaHsvjrnXF0SvGcchXSjn ilrvFcA6FrrssnGrG4HG/UyqFH1gTi5k1LE6ZZ3kZslx0i0jlwo96GyoWOSboy2drmeK TSJe03v1+pPv9k1wacKf0Ekyazd8V40F3qaKmgvx/SYSwHHSY1UqOQo4FpxwRUVrYS9x hTy/nHD9i0Wa92gMBcDzDnfOip695xdNI9hpLbMnRjwAE6Y7pdb/fMbJXY+pl4PVDTwP cq2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WN7amoro; 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=fail (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 v69si15156959pgd.284.2018.11.11.20.17.26; Sun, 11 Nov 2018 20:17:42 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=WN7amoro; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730603AbeKLOIW (ORCPT + 99 others); Mon, 12 Nov 2018 09:08:22 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40669 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbeKLOIW (ORCPT ); Mon, 12 Nov 2018 09:08:22 -0500 Received: by mail-wm1-f67.google.com with SMTP id z8-v6so618718wma.5 for ; Sun, 11 Nov 2018 20:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lLJXrIqYM8TU/W6Zal1zkWGH1kuS9Sn6oelDMQ/ByZ0=; b=WN7amoroUOx/aF4g3ObV5EgZ5pVl9eBdDhGl+pdGNXO01hWCiB6QppOEbVKWpbnHkD +J6I9VzDM5RznQq3TTO9ynjyflV3WWFivO/T9MwWS5evyBE4wq9NVwUIfjoPWWOymCL+ nv9N4PvA2uVfO8+zT0PIXMr0hqstI8S/SmR1pQ0zSxxr2MHpEdpPz4zm1eGkVAqs/5h4 dCAKyl9FbQtRO5bwMARI8aqPMQ95yMkl6s6QpoNSfQEynmuc+AF7ezCCBVpZWwFrHJyM 6TMVtLHz4D5AlfgYIcZlX6JX2rrWy8LJMCDlmd8POXTuvFI9c7py8tEbRM9k97DdJoSR 1e9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=lLJXrIqYM8TU/W6Zal1zkWGH1kuS9Sn6oelDMQ/ByZ0=; b=KtQ/WPOq7O/tj4unzHS+B+EgWCf4ILK1ncjtrDDo3f5NFxb8B7LBTDzdDRDd2y9rPv VYk10F2Howmb5e1KojpLzEbYhaxxVPzgLNOe2oYgisqByhWy0kSkiQOdSFHHoIXN62Tg yXlA2GVCF2EmxfX9faBWyJPBz+TOKfWdO6r6sjDGS5PR41i/KGI6ZuAndwFHnrWfKxmq aWCtTNKwP8MljPkobB6Ylw+ZElVNjGLEgnXt1MaUUdZsHXh+A3oAZKmEFwLAGVD9i+FL DWYlPU37Bal1b+8brqXLLic6PLGtgQLvq3cmo8fjMu6ZmJQf6Qd7go9iXOmmmHdAf8Co D6vw== X-Gm-Message-State: AGRZ1gKnjie0UVG81As0X2sbZD3Z/mwy92NuLBsNif9/mIiJncfukh8T BlL6RgeXrRSX+JVzH/aGHWA= X-Received: by 2002:a1c:9690:: with SMTP id y138-v6mr6185188wmd.67.1541996219952; Sun, 11 Nov 2018 20:16:59 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id q11-v6sm11865608wrj.7.2018.11.11.20.16.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Nov 2018 20:16:59 -0800 (PST) Date: Mon, 12 Nov 2018 05:16:56 +0100 From: Ingo Molnar To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Vincent Guittot , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v2 3/3] sched/fair: add lsub_positive and use it consistently Message-ID: <20181112041656.GA47272@gmail.com> References: <20181105145400.935-1-patrick.bellasi@arm.com> <20181105145400.935-4-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181105145400.935-4-patrick.bellasi@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Patrick Bellasi wrote: > The following pattern: > > var -= min_t(typeof(var), var, val); > > is used multiple times in fair.c. > > The existing sub_positive() already capture that pattern but it adds > also explicit load-sotre to properly support lockless observations. > In other cases, the patter above is used to update local, and/or not > concurrently accessed, variables. > Let's add a simpler version of sub_positive, targeted to local variables > updates, which gives the same readability benefits at calling sites > without enforcing {READ,WRITE}_ONCE barriers. > +/* > + * Remove and clamp on negative, from a local variable. > + * > + * A variant of sub_positive which do not use explicit load-store > + * and thus optimized for local variable updates. I fixed up the two typos ('load-sotre', 'patter'), and fixed eight grammar mistakes (!) in the changelog and in the code comments, but *please* read the changelogs and code you are writing, this is scheduler code after all ... ( Please also use the fn() notation in changelogs consistently in the future: first you use 'sub_positive()' correctly then it becomes 'sub_positive'. ) Anyway, the fix looks sane so I've applied it to sched/urgent. Thanks, Ingo