From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD54CC433E0 for ; Thu, 18 Feb 2021 16:21:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 29B2664E85 for ; Thu, 18 Feb 2021 16:21:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29B2664E85 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8C7D76B006C; Thu, 18 Feb 2021 11:21:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 878896B006E; Thu, 18 Feb 2021 11:21:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 718966B0070; Thu, 18 Feb 2021 11:21:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id 5BC196B006C for ; Thu, 18 Feb 2021 11:21:57 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 235C05DF3 for ; Thu, 18 Feb 2021 16:21:57 +0000 (UTC) X-FDA: 77831905074.02.A3D617D Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf27.hostedemail.com (Postfix) with ESMTP id ED8C480192E1 for ; Thu, 18 Feb 2021 16:21:52 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id cl8so1640718pjb.0 for ; Thu, 18 Feb 2021 08:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7vviwcmISf9SauaMuvs/shrly/ZIB570cD7CHEN4n8M=; b=aee4RfHC3S11MQQnocAxac6OvJxnqTUJpJs6OeBXqnvBK7VUpL3Rq16ldY2nn4n7Mm Qdqf6nGxbqEbQdiMAY7X0nsfgi/8/O7Osio/lFdO2BdTpVvx/ILfACQpZf59JSfEK8/H aS+i5uAZM/UTzYRHFcUaJI6owz3dZBSCmdFwy2INXL1GtDtHyebkQ4Hph66cUvFQGBfA lerhWNQ/XXlU1Y5hdXQIVa/iZLTaETmlghxAFW4Wh6RmbtgkI4wETNGD3E/iDmVSBa3j z5z9zpGAoAbpuCyDlvWyM0QYJzQRYgwh6AN1+goDsZ5ESYNUh+yfM+pRXPB0tWkLZzO3 8UHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=7vviwcmISf9SauaMuvs/shrly/ZIB570cD7CHEN4n8M=; b=eD6XS2ANNB40s1FAq216RvVognUW1+mrSebH5pmaPdKxfAlpu83x7MHLLN6VoIXHh/ Jj0jH905d8v5Ws+6Gs+aSJ51BZYdA725M/PvR7nMAfRWjTFwf3XoC0ylg/NXxYCHfsth 2YV16NsAtzxJVFXqtYHpowXJ/Sla0WKeQgzKMGNJowalHuRb4UIMOiEZu1l+rS0nRnrH Ih8Km7cOwoiCdvwDzwyw+xya9Q5iwgQdbjt6jXTuFTXQveE9G4FR7B2kyuXl7e76YU/Q r4M0pKuzZfYnu9R9ND9EgoPp+0duXZje9yUru6NRqPxh7RC1bxbYJvJ9UjgSK/23qwTI YOsQ== X-Gm-Message-State: AOAM532IUrbXogi4uysAbVYjsXbAtCpv9UVIQPHR1CYK/fMyhlKfNxtN JAUjLltwDeVtlJYzOUuqavA= X-Google-Smtp-Source: ABdhPJxrM9/dyqY4UwBfRlHLEX1b7TPs6emR6tomMd97RsPWpc+hpGIzJXcYC88DpB8T88emHCtCzg== X-Received: by 2002:a17:902:6bca:b029:e2:c5d6:973e with SMTP id m10-20020a1709026bcab02900e2c5d6973emr4655370plt.40.1613665315616; Thu, 18 Feb 2021 08:21:55 -0800 (PST) Received: from google.com ([2620:15c:211:201:157d:8a19:5427:ea9e]) by smtp.gmail.com with ESMTPSA id x17sm6727848pfq.132.2021.02.18.08.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 08:21:54 -0800 (PST) Date: Thu, 18 Feb 2021 08:21:52 -0800 From: Minchan Kim To: Michal Hocko Cc: Matthew Wilcox , Andrew Morton , linux-mm , LKML , cgoldswo@codeaurora.org, linux-fsdevel@vger.kernel.org, david@redhat.com, vbabka@suse.cz, viro@zeniv.linux.org.uk, joaodias@google.com Subject: Re: [RFC 1/2] mm: disable LRU pagevec during the migration temporarily Message-ID: References: <20210216170348.1513483-1-minchan@kernel.org> <20210217211612.GO2858050@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 5ug4yt3ujeph914bor3zf4i8wnar6tw4 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: ED8C480192E1 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mail-pj1-f47.google.com; client-ip=209.85.216.47 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613665312-672666 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 18, 2021 at 05:08:58PM +0100, Michal Hocko wrote: > On Thu 18-02-21 07:52:25, Minchan Kim wrote: > > On Thu, Feb 18, 2021 at 09:17:02AM +0100, Michal Hocko wrote: > > > On Wed 17-02-21 13:32:05, Minchan Kim wrote: > > > > On Wed, Feb 17, 2021 at 09:16:12PM +0000, Matthew Wilcox wrote: > > > > > On Wed, Feb 17, 2021 at 12:46:19PM -0800, Minchan Kim wrote: > > > > > > > I suspect you do not want to add atomic_read inside hot paths, right? Is > > > > > > > this really something that we have to microoptimize for? atomic_read is > > > > > > > a simple READ_ONCE on many archs. > > > > > > > > > > > > It's also spin_lock_irq_save in some arch. If the new synchonization is > > > > > > heavily compilcated, atomic would be better for simple start but I thought > > > > > > this locking scheme is too simple so no need to add atomic operation in > > > > > > readside. > > > > > > > > > > What arch uses a spinlock for atomic_read()? I just had a quick grep and > > > > > didn't see any. > > > > > > > > Ah, my bad. I was confused with update side. > > > > Okay, let's use atomic op to make it simple. > > > > > > Thanks. This should make the code much more simple. Before you send > > > another version for the review I have another thing to consider. You are > > > kind of wiring this into the migration code but control over lru pcp > > > caches can be used in other paths as well. Memory offlining would be > > > another user. We already disable page allocator pcp caches to prevent > > > regular draining. We could do the same with lru pcp caches. > > > > I didn't catch your point here. If memory offlining is interested on > > disabling lru pcp, it could call migrate_prep and migrate_finish > > like other places. Are you suggesting this one? > > What I meant to say is that you can have a look at this not as an > integral part of the migration code but rather a common functionality > that migration and others can use. So instead of an implicit part of > migrate_prep this would become disable_lru_cache and migrate_finish > would become lruc_cache_enable. See my point? > > An advantage of that would be that this would match the pcp page > allocator disabling and we could have it in place for the whole > operation to make the page state more stable wrt. LRU state (PageLRU). Understood. Thanks for the clarification.