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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 4EFADC433E0 for ; Thu, 18 Feb 2021 08:24:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CAB1A64DF0 for ; Thu, 18 Feb 2021 08:24:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAB1A64DF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 410E96B0006; Thu, 18 Feb 2021 03:24:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 39B1C6B006C; Thu, 18 Feb 2021 03:24:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2617F6B006E; Thu, 18 Feb 2021 03:24:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 0C2B16B0006 for ; Thu, 18 Feb 2021 03:24:37 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C4E7612DB for ; Thu, 18 Feb 2021 08:24:36 +0000 (UTC) X-FDA: 77830702152.14.bag21_5206c7d27653 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id A59D218229818 for ; Thu, 18 Feb 2021 08:24:36 +0000 (UTC) X-HE-Tag: bag21_5206c7d27653 X-Filterd-Recvd-Size: 4174 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 08:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613636675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4/ZLB+LGzU8OCPH9fs/lC8xxc437w5UN3WLlRuc6l1s=; b=RcZjhCg2vBesepTcANxga0Gkj5wW0HkSHbEVlKSgrIDTNKiUF2Hcq2q2HAxvrAXXcy0bIb 57tq9VuDy6iEyIMweEOvXWdRlAKq45I5NyCOZSTDXuvWRYCod+4jZ/HnFbFrd7ovairtn3 aGEuTQc0RBor2iIXTCmHsU+sBqUyLKE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-idMIFum9OKKWuzNa2wzPYA-1; Thu, 18 Feb 2021 03:24:32 -0500 X-MC-Unique: idMIFum9OKKWuzNa2wzPYA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5034108C20A; Thu, 18 Feb 2021 08:24:30 +0000 (UTC) Received: from [10.36.114.59] (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61CFF5C3E4; Thu, 18 Feb 2021 08:24:28 +0000 (UTC) Subject: Re: [RFC 1/2] mm: disable LRU pagevec during the migration temporarily To: Michal Hocko , Minchan Kim Cc: Matthew Wilcox , Andrew Morton , linux-mm , LKML , cgoldswo@codeaurora.org, linux-fsdevel@vger.kernel.org, vbabka@suse.cz, viro@zeniv.linux.org.uk, joaodias@google.com References: <20210216170348.1513483-1-minchan@kernel.org> <20210217211612.GO2858050@casper.infradead.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <0c9bc288-4713-f552-ce97-d050eb749e20@redhat.com> Date: Thu, 18 Feb 2021 09:24:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 18.02.21 09:17, 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. > Agreed. And dealing with PCP more reliably might also be of interest in context of more reliable alloc_contig_range(). -- Thanks, David / dhildenb