Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2965847imu; Wed, 7 Nov 2018 02:41:04 -0800 (PST) X-Google-Smtp-Source: AJdET5cKIxXTpEJTvi4I19rrE7Gwny/9LhFB+7E363NBg95ndZgnbukfmSZE/meW1u8uIGophgl9 X-Received: by 2002:a62:fc52:: with SMTP id e79-v6mr1270646pfh.167.1541587264028; Wed, 07 Nov 2018 02:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541587264; cv=none; d=google.com; s=arc-20160816; b=PU8uSSmC/k6oCe9tpyzZkzwR8HY9Mi2vD7z8TARbqj02psVUn4XpBT13mww56tpVXj Jc0npsNR/h0RYPRdUxoFStJcu4+biijpH9sA3h7W/NEUr8kXFQCWd1rfPltBlUrdcix1 8FGOPh75L01pE6DlC+ZWvsCO2xEyLRnSjp/phdHHsqK1tEKjceFavT+soNsW2R48KUjC 4L6E+CvYAp3wWQcnATnlxFLSzRc7WPi/pXgjisDBFydwTdeRjJp6jJVVAhJ85FKAvqGB wdtSrXKokKeZ4i2YojbAsNiyj2y9umi0+WyQ/9REbcTJYGHMLn5MDObTW4ZuZEf0IZ1z Syjg== 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; bh=mlPDyYHWj3tZNrlVhcoYvZqtuVWhLCJY2Asz6oBfBUU=; b=xIx0yU1xIxPAzkyRx/o/pEoa8+LLmZzSr32fcpayn0ICeZz2OtvoDj9p68N0HQF2q6 1hum8P1EzwI6C9IxNexq+pdiBeYzUzVWUAVS1AX9OOwR55ZmO1c+a3jaPxpMKCvpSs4o 5c2X/6jKL6LatqAsfiPD5tw8V+CfC/+XmeL5YMT8FvogIdWumugNq7LllozEgDSBCQw9 MZaD+xD9j6ZYpQ/dQnaa8uD+8fp9DT3LlMEl8+EaGit11RUBOckLmHHow9xfYcZpZD39 yaGw50h9Y0oCeutCxPtCDPM5i/OAb5d0GM25qSpwPepk+4f2X3GfJFlwnx63iFKSNIcK JMDA== ARC-Authentication-Results: i=1; mx.google.com; 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 g8-v6si297361pli.13.2018.11.07.02.40.49; Wed, 07 Nov 2018 02:41:03 -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; 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 S1730780AbeKGUJj (ORCPT + 99 others); Wed, 7 Nov 2018 15:09:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:33294 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726225AbeKGUJj (ORCPT ); Wed, 7 Nov 2018 15:09:39 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 87425B6E0; Wed, 7 Nov 2018 10:39:51 +0000 (UTC) Date: Wed, 7 Nov 2018 11:39:50 +0100 From: Michal Hocko To: Vlastimil Babka Cc: Konstantin Khlebnikov , Arun KS , keescook@chromium.org, minchan@kernel.org, getarunks@gmail.com, gregkh@linuxfoundation.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, julia.lawall@lip6.fr Subject: Re: [PATCH v1 0/4]mm: convert totalram_pages, totalhigh_pages and managed pages to atomic Message-ID: <20181107103950.GD27423@dhcp22.suse.cz> References: <1540551662-26458-1-git-send-email-arunks@codeaurora.org> <9b210d4cc9925caf291412d7d45f16d7@codeaurora.org> <63d9f48c-e39f-d345-0fb6-2f04afe769a2@yandex-team.ru> <08a61c003eed0280fd82f6200debcbca@codeaurora.org> <10c88df6-dbb1-7490-628c-055d59b5ad8e@yandex-team.ru> <22fa2222012341a54f6b0b6aea341aa2@codeaurora.org> <89a259aa-156e-041c-b3bc-266824acb173@suse.cz> <20181107102837.GC27423@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181107102837.GC27423@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 07-11-18 11:28:37, Michal Hocko wrote: > On Wed 07-11-18 09:50:10, Vlastimil Babka wrote: > > On 11/7/18 8:02 AM, Konstantin Khlebnikov wrote: > [...] > > > Could you point what exactly are you fixing with this set? > > > > > > from v2: > > > > > > > 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? > > > > > > > > > Aligned unsigned long almost always stored at once. > > > > The point is "almost always", so better not rely on it :) But the main > > motivation was that managed_page_count_lock handling was complicating > > Arun's "memory_hotplug: Free pages as higher order" patch and it seemed > > a better idea to just remove and convert this to atomics, with > > preventing potential store-to-read tearing as a bonus. > > And more importantly the lock itself seems bogus as mentioned here > http://lkml.kernel.org/r/20181106141732.GR27423@dhcp22.suse.cz Should be http://lkml.kernel.org/r/20181107103630.GF2453@dhcp22.suse.cz -- Michal Hocko SUSE Labs