Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7080867imu; Wed, 14 Nov 2018 11:22:47 -0800 (PST) X-Google-Smtp-Source: AJdET5eGWN6SHjIVaZa25h28BLfSG3CU6EGRMiVWFoWXzsCj1A+nIr6q+RLnN7x6M1Zf0b8dGUDC X-Received: by 2002:a62:1f9d:: with SMTP id l29mr3263306pfj.14.1542223367524; Wed, 14 Nov 2018 11:22:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542223367; cv=none; d=google.com; s=arc-20160816; b=Qt7znmQLJf28S0daKoha9kdkHf1vNEMPYUJKlTEiT/Q5LkWN7FyVkNs52dHIU7aCw/ HgKIeJwdMwDVX/cD0brcmp1bAZuBFmnGnkNllf8v/EyH0jbNygtYp8ON7phAu47BRSfN juNeklDQwsHvM10FjQpKbf97OeIUMbY2LDYxzXTRfHyLM4aYaxnWJaYViIXWgKWJ5A2g HX0r0NvT3N2R9nC+pqKhv/9ZcUw/yktxFmLheXFJmVmS7ZlFz5eJgwWPwd+UiJdaREbK ngmtGEgUtK8Obglhc/B9XTZp+Qscpd3Bd2RzzXwlSL2xvM98ycVKB8QVwGbrrPr42Abk j2GA== 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=TwXLRXW1McRoBW58WPePaegdLlE/EQnLmr9bDSfz/kk=; b=Ju25/8SonC2c+u8zpR7kbqCr8ki4/Cx1ivv3XnGgkX5W1iOyvo5PF+dfv4VPpjF33x jX4AacbzAmXIVLboRzZgPo3IvhhdxLFAQr/nMQK+qPoy6C0w0ZmV2hHmXtryev+oYDX3 o7VakXbtJBbQ36rUF5XKT++D1oiTzuYHgExp/tYOumE23UD312lrL+ZwdmXoI/68Vd4e sMT1O33oFtvM73bWhAjpA91HbQPQw8onmWxlyCtuJjEx9VdlOYqlj9PM001Ayf2pRjNp lL9YP3vDod+Qvi/PNWgjvg5+2IhzivY9Uv82/szdqWSSXBbDuRASyXbXcwmJ8ZfV2Yuz BVzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=GRQZYCa9; 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 k3-v6si25681690pld.25.2018.11.14.11.22.31; Wed, 14 Nov 2018 11:22:47 -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=pass header.i=@soleen.com header.s=google header.b=GRQZYCa9; 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 S1726448AbeKOF03 (ORCPT + 99 others); Thu, 15 Nov 2018 00:26:29 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:43302 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725756AbeKOF03 (ORCPT ); Thu, 15 Nov 2018 00:26:29 -0500 Received: by mail-qk1-f195.google.com with SMTP id r71so27819032qkr.10 for ; Wed, 14 Nov 2018 11:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TwXLRXW1McRoBW58WPePaegdLlE/EQnLmr9bDSfz/kk=; b=GRQZYCa9Tj7Lhpuu7fte6kI4upKHOGdLBRXlAmqgeLEZ5LfPfdKvnhJq96u3YFy5MJ 8QPKUEuIsYBw2+F3vNLpmgV9rVih82vSnQvjrJvdSCbnDUoutoOBBsQa0SQ8ZdJnXIxG WD7M1Cx0KXYJ5wm31ttAaWRjKi+qwfCuettspcPhKN40Rsc8FHGYomceUxzI/ZazTYiK 5pM1i5i4quItrZoMPAkBMKsNqJxaqjQLgN6wwGxMTjJzSBXccZf4g+OPdO8yBXpV/CXf dQoJDYu3r5oGde/3BpY2lBYF9vlOWaSJ6xu8jluSF64/zbKFd2NAP8RBtHw/WuGkU5TG mhwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TwXLRXW1McRoBW58WPePaegdLlE/EQnLmr9bDSfz/kk=; b=MtGVo6lU3usnGOOrF+NA9K36Z3H2GGlJf8vIJsf5d3o52YXNdHZtXNbSfhYFUy+k81 anFN/IITZeAWoDpNTDtYuusuaqJhEnBuW+U2TauPzAp+/qL5E4+kkXRYvlwkPnZS4YjG 8bXG2szIU73mF9HcF7Gc6UrwGK4Lc4T5rxqvBzvlkGMAfC+aZWzq/uJLggdi+Cm9h9WV LAfobLtw9lslLwTWyPfuGTrCgKrA/WdLsj8cJtT54/xoZs1UNKSPBaxDKiKzel97V9TM meH4/06IeFcpiwBEsmMObEFO8Dz9dSrsZfpczr13Uz+fuonEvZX8aT5uXTGcip0yNMC1 Kw2g== X-Gm-Message-State: AGRZ1gK3e6eT1euukmbSq4YnMXFxoX1Bu0TcpJ4Q2t+vWw2ajd9eZfMr wVXX5Xu43Hd++UxSjoCKrQeBOQ== X-Received: by 2002:a37:a24b:: with SMTP id l72mr3100590qke.302.1542223319236; Wed, 14 Nov 2018 11:21:59 -0800 (PST) Received: from soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net ([40.117.208.181]) by smtp.gmail.com with ESMTPSA id z8sm16730462qth.34.2018.11.14.11.21.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:21:57 -0800 (PST) Date: Wed, 14 Nov 2018 19:21:54 +0000 From: Pavel Tatashin To: Arun KS Cc: keescook@chromium.org, khlebnikov@yandex-team.ru, minchan@kernel.org, getarunks@gmail.com, gregkh@linuxfoundation.org, akpm@linux-foundation.org, mhocko@kernel.org, vbabka@suse.cz, linux-kernel@vger.kernel.org, linux-mm@kvack.org, vatsa@codeaurora.org, willy@infradead.org Subject: Re: [PATCH v5 2/4] mm: convert zone->managed_pages to atomic variable Message-ID: <20181114192154.cf2kz5pqcokpzpyt@soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net> References: <1542090790-21750-1-git-send-email-arunks@codeaurora.org> <1542090790-21750-3-git-send-email-arunks@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542090790-21750-3-git-send-email-arunks@codeaurora.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18-11-13 12:03:08, Arun KS wrote: > totalram_pages, zone->managed_pages and totalhigh_pages updates > are protected by managed_page_count_lock, but readers never care > about it. Convert these variables to atomic to avoid readers > potentially seeing a store tear. > > This patch converts zone->managed_pages. Subsequent patches will > convert totalram_panges, totalhigh_pages and eventually > managed_page_count_lock will be removed. > > Main motivation was that managed_page_count_lock handling was > complicating things. It was discussed in length here, > https://lore.kernel.org/patchwork/patch/995739/#1181785 > So it seemes better to remove the lock and convert variables > to atomic, with preventing poteintial store-to-read tearing as > a bonus. > > Suggested-by: Michal Hocko > Suggested-by: Vlastimil Babka > Signed-off-by: Arun KS > Reviewed-by: Konstantin Khlebnikov > Acked-by: Michal Hocko > Acked-by: Vlastimil Babka Reviewed-by: Pavel Tatashin