Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3030489ima; Mon, 22 Oct 2018 22:12:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV60+Uhk9ioisZkmtS1JzGoAllkQh3s6SqQMiA/KYXD3jIuKmkHViA9E63NPmOq4Y1sNfXXBC X-Received: by 2002:a65:664e:: with SMTP id z14-v6mr43955033pgv.347.1540271567132; Mon, 22 Oct 2018 22:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540271567; cv=none; d=google.com; s=arc-20160816; b=rNxU/kQ9ZFhBE8T1KF8lpTPEAbVNGlXTO3Ty8np9VxOcCViNa1EksKFLDEmzBaGWgU Jgqy5jN1jI00vxTvNkyLc27OlfR4lEAje/6hyWQ4UC56BX1VEwNkIE+mvEoT8z3mhe9t jFu0XbpUmHS9PK0H9rEptN0g26tgWOgVB/Dbx6L0keMI5US9uB1XxSqGWwHNAtPvhMcJ OHFlsuVD4UMr8i6M2ENbiSLHPzKA6nJ7Gl9Z0WtwFYTcFv4La2NOnQgylUJUBDPZu3R3 DtAitNJXmdod7djqwMPPoMb4UFcaNenu48bhjXSCEgZ7EQCpILH0J17ZXpT/N+dBJOp7 LBPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature:dkim-signature; bh=A36DZiW5Y8mEoCxwxkdOEkt05TaKv+uqXh94oODi+GI=; b=iNdFrvKbc9nWehjsfhiBBXg7Jl+rvndWqt3/HHVXNjvQHoij4llKjqv/I71R0Sbplw 7MI+EFIEK/MqcPIPuKvewfpMXleNch9/IICaPKBvWA7aJU1q/IcSKfQcfHspI7gHlsSL y/rah7aYkr71Ir8zLK37vPkmfDe8o8UCVh8T28S0kizPfO+FFFZNsX0GffOGVdS0t8bv 5HwLRrxtzS6wipVYnkHZ02EjW0EcbbckV0YZq9JJnmKyCOhYjMrPAuGtBKCDllbksEMf R9LOrn9XoH8Iy/Dx9UxKXzP/BwERy/h0fhzMYgGRGMFhPKj+gUqrI0UMvdkE1H94fiXZ /J+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=G+eZ6SMr; dkim=pass header.i=@yandex-team.ru header.s=default header.b=G+eZ6SMr; 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=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22-v6si183444pgh.8.2018.10.22.22.12.18; Mon, 22 Oct 2018 22:12:47 -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=@yandex-team.ru header.s=default header.b=G+eZ6SMr; dkim=pass header.i=@yandex-team.ru header.s=default header.b=G+eZ6SMr; 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=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbeJWNdS (ORCPT + 99 others); Tue, 23 Oct 2018 09:33:18 -0400 Received: from forwardcorp1g.cmail.yandex.net ([87.250.241.190]:51064 "EHLO forwardcorp1g.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727101AbeJWNdR (ORCPT ); Tue, 23 Oct 2018 09:33:17 -0400 Received: from mxbackcorp1j.mail.yandex.net (mxbackcorp1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::162]) by forwardcorp1g.cmail.yandex.net (Yandex) with ESMTP id D761B20F29; Tue, 23 Oct 2018 08:11:31 +0300 (MSK) Received: from smtpcorp1p.mail.yandex.net (smtpcorp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:10]) by mxbackcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bfHUNgVcrI-BVI0A9ju; Tue, 23 Oct 2018 08:11:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1540271491; bh=A36DZiW5Y8mEoCxwxkdOEkt05TaKv+uqXh94oODi+GI=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=G+eZ6SMrZfYN+lB3gY6gzZdep1oIRYIdCSU2gzwx81G17Fu6Ff6FEHY0lwdCvYXvc v1OgTDPN+5Pxs2DRXc5KRfCK4ZLk7fzMglXR85aPg4sqezsEUg1Gq4UVjkFAfx7zdD iark9mwo+84HP4DNoTyV9QjVuwLIu4v+FhjGxSgk= Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:2501:1cc0:44e4:e39a]) by smtpcorp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PYezhgoTGU-BVWaDWLX; Tue, 23 Oct 2018 08:11:31 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1540271491; bh=A36DZiW5Y8mEoCxwxkdOEkt05TaKv+uqXh94oODi+GI=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=G+eZ6SMrZfYN+lB3gY6gzZdep1oIRYIdCSU2gzwx81G17Fu6Ff6FEHY0lwdCvYXvc v1OgTDPN+5Pxs2DRXc5KRfCK4ZLk7fzMglXR85aPg4sqezsEUg1Gq4UVjkFAfx7zdD iark9mwo+84HP4DNoTyV9QjVuwLIu4v+FhjGxSgk= Authentication-Results: smtpcorp1p.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic. To: Joe Perches , Arun KS , linux-kernel@vger.kernel.org, linux-mm , Minchan Kim , Michal Hocko , Arun Sudhilal , Greg Kroah-Hartman , Andrew Morton References: <1540229092-25207-1-git-send-email-arunks@codeaurora.org> From: Konstantin Khlebnikov Message-ID: <15247f54-53f3-83d4-6706-e9264b90ca7a@yandex-team.ru> Date: Tue, 23 Oct 2018 08:11:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.10.2018 7:15, Joe Perches wrote:> On Mon, 2018-10-22 at 22:53 +0530, Arun KS wrote: >> Remove managed_page_count_lock spinlock and instead use atomic >> variables. > > Perhaps better to define and use macros for the accesses > instead of specific uses of atomic_long_ > > Something like: > > #define totalram_pages() (unsigned long)atomic_long_read(&_totalram_pages) or proper static inline this code isn't so low level for breaking include dependencies with macro > #define totalram_pages_inc() (unsigned long)atomic_long_inc(&_totalram_pages) > #define totalram_pages_dec() (unsigned long)atomic_long_dec(&_totalram_pages) these are void conversion zone->managed_pages should be split into separate patch [dropped bloated cc - my server rejects this mess]