Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7125565pxb; Thu, 18 Feb 2021 02:01:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbN4Q+yen3fMzWQrm72mEyXKxfflosuXKvV5Nu4ructcrVeYVlRcmFX8F9nPo+zDsDvwpR X-Received: by 2002:a05:6402:5:: with SMTP id d5mr3378557edu.121.1613642468851; Thu, 18 Feb 2021 02:01:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613642468; cv=none; d=google.com; s=arc-20160816; b=XuFmN78BdAUwjq0XH3P4bF4PkQ9ju7VPsOJr/84f/FRNfLm71sZTYAgIGwxCWORDfl 80dJJXGzhddiIBqM8Uhii5uoN2XkqXXzfVH1HrdU770+1CfQgNsyjQb8kYbCN7sTo+57 NwPtYw6/4wtYbVXcplS2yN3NQoUrx8GJHVjDllBjJyvRARgbZWh3OBLZbW65ZVP/mRn4 wFZmqTawxls2IJ0TRxrkMrviCcIplmG7GgrGvsX8HUck4aodlU9/CP0ZrmEUJABLqnpa iI6PG1CffrJTXm/rvgv11u43u9KV6CNoXrtpm8ALwwi3oO09ctSIhFkvDSU5zx1rSIlI J3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=4/ZLB+LGzU8OCPH9fs/lC8xxc437w5UN3WLlRuc6l1s=; b=KSPUVZ7jwOBIF+GMW7uKCUH8LEroSJpWdYA4GNZknrzlTueugeOHZULa4KZLQ9gkLx HUbx2htlCdziOL9zVq6k4l/V7vuHZ+NVSdmjrQpLrGnzbDOMe8jhTGaZGJBP7Q83tI6V MoN7LoR+xs91CIPSf04e38vvsS9YZvqWqMox9rAjYiW4IxUYMYi8E6C0PTIvkoG5qq/d 5lQoygZN488Uj4dDxPBYC7m+Zx2757IoN6OoqEyVQCqOG8YSg9zzUGe4hx03oWNJ/C9f IHAGBXMkTJT7XFoSWke4yjtl8TNcIK/GN86e97qfqhyB5T6xrApRQ1r4OkwjshLaRykC jwnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HOQaJHX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si3292817edc.561.2021.02.18.02.00.45; Thu, 18 Feb 2021 02:01:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HOQaJHX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232170AbhBRJhC (ORCPT + 99 others); Thu, 18 Feb 2021 04:37:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54066 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231159AbhBRI0G (ORCPT ); Thu, 18 Feb 2021 03:26:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613636677; 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=HOQaJHX3Q8dX7JU0Q9gAixtifV6VVz6OzxEy+l9OzH9yqxKuzApiHHMxf7XSLIP7XmE0lw d+t0KMwvP4nVI4UR473XRzbKjwKMiDcn7jql5QXyeMU5pqnrCFPuK1Qk8oL19C33Wulzn+ F2l1Qgq3aDgYJINtxQwi7X7Ms7N7YOA= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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