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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 7731AC433DB for ; Thu, 18 Feb 2021 08:17:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ED5F661493 for ; Thu, 18 Feb 2021 08:17:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED5F661493 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5AAB16B006E; Thu, 18 Feb 2021 03:17:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 55AFB6B0070; Thu, 18 Feb 2021 03:17:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 471746B0071; Thu, 18 Feb 2021 03:17:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id 31B596B006E for ; Thu, 18 Feb 2021 03:17:07 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E3A31824999B for ; Thu, 18 Feb 2021 08:17:06 +0000 (UTC) X-FDA: 77830683252.05.cake07_0f1220b27653 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id C352F18024A7E for ; Thu, 18 Feb 2021 08:17:06 +0000 (UTC) X-HE-Tag: cake07_0f1220b27653 X-Filterd-Recvd-Size: 3069 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 08:17:06 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613636225; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Bj/aH3giPAzDAL2y3Ty2YYSPPYbJXATBOZlDn8p3zgk=; b=VDHjKwZsViPrHpIlr1FHzb/cMaEynstaEefSnWRDaSgAOFC76HQZs9eXODQ5c4YHQRUOSc a1cW3Y5m0Pf2yq6Fr4gGSdz//gs5xy3MfWX63caE+c2ax/hdrv4T3T8wFi2slkFuidkXsM Uol9XwgIBzKOiZczO++jWUhchdMjYoI= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 06A05AC6E; Thu, 18 Feb 2021 08:17:05 +0000 (UTC) Date: Thu, 18 Feb 2021 09:17:02 +0100 From: Michal Hocko To: Minchan Kim 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-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 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. -- Michal Hocko SUSE Labs