Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2956930imu; Wed, 7 Nov 2018 02:29:51 -0800 (PST) X-Google-Smtp-Source: AJdET5cMm8jPJnwUpNSYgZATnk5MQFibsm+y1z5y0uwOx1jIvAGPAcMhaPKvltjEA4awberZNuz8 X-Received: by 2002:a62:9f98:: with SMTP id v24-v6mr1305806pfk.108.1541586591175; Wed, 07 Nov 2018 02:29:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541586591; cv=none; d=google.com; s=arc-20160816; b=m3w1Fg6RliQfVs7nXtxeMjhqXkrbg+XJTkHMI9KJMa/6D9spefQTZrGg46AaVzx5gO lRK88AeyuS5qeaPLagXu73wkraBpBl/t0n0CMZqgGXMzkgXQkV6hrijVmEW4EzyextHX NjL4psL18S4fPqt6fP/t2aSkweE8SnTKsuZXffcmwF3feYNwpwxPMXfdSB/vc1kXc926 /mJ2mryeRrOSXNiB1UfhGR73jOM9I8pvGjNqgKXiSfuTLpniPY3f/eV+rATReZDNB/+c la2Ohi3GZBQgLd+qbZSV3QD59ck0bj4xYzylELMxMNIV0Fca0VV01BSHM4Dn9rjJp8J6 f2Eg== 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=4+oSyc2bpQFjZZFzNNKfIMqarknUKoVJl7aMlKX7yZk=; b=rD0hg2xt2LK4KHYOuWRrmfHMOuzbXD5dTckSwQGkVbUaepG9JsS6aDJ6wEueIUYD5v JyJyUEJ03oDE/wMnXy7DVQhjG4dqt0ds9N5n3NMnS3ksnQn3bRB3hAyv43EjW7ATEgqH HY69aNMibyNzym2LLGU4/GgCKlZOZKQTPJEAs7pzzNKl0S+OdBmk5sqd7L6vY8PbWe3T 30cF/4ccVjHrzZxXrH0vAVpPkHcgZqik63aANfMKp4eJQaMr6hU2DPzTPbtA6HywUUEo 3H0J3PnutJ2bhnzqyTaE+EXWMGtYL7ugS46gZOzBLvaI2LxzpD375XlKHB/B03Ma39Xn rAYg== 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 bb4-v6si223831plb.170.2018.11.07.02.29.35; Wed, 07 Nov 2018 02:29:51 -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 S1730493AbeKGT6Y (ORCPT + 99 others); Wed, 7 Nov 2018 14:58:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:59436 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726218AbeKGT6Y (ORCPT ); Wed, 7 Nov 2018 14:58:24 -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 0762AAF9B; Wed, 7 Nov 2018 10:28:38 +0000 (UTC) Date: Wed, 7 Nov 2018 11:28:37 +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: <20181107102837.GC27423@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89a259aa-156e-041c-b3bc-266824acb173@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 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 > It would be nice to mention it in the changelogs though. agreed -- Michal Hocko SUSE Labs