From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by kanga.kvack.org (Postfix) with ESMTP id 91D146B0003 for ; Tue, 23 Oct 2018 01:11:34 -0400 (EDT) Received: by mail-lj1-f198.google.com with SMTP id k1-v6so47767ljk.9 for ; Mon, 22 Oct 2018 22:11:34 -0700 (PDT) Received: from forwardcorp1g.cmail.yandex.net (forwardcorp1g.cmail.yandex.net. [87.250.241.190]) by mx.google.com with ESMTPS id c4si202754lff.66.2018.10.22.22.11.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 22:11:32 -0700 (PDT) Subject: Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic. 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 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: owner-linux-mm@kvack.org List-ID: To: Joe Perches , Arun KS , linux-kernel@vger.kernel.org, linux-mm , Minchan Kim , Michal Hocko , Arun Sudhilal , Greg Kroah-Hartman , Andrew Morton 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]