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.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 5BCEDC433DB for ; Fri, 12 Mar 2021 09:33:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E4A4264F00 for ; Fri, 12 Mar 2021 09:33:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4A4264F00 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 57E498D0343; Fri, 12 Mar 2021 04:33:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 506808D0317; Fri, 12 Mar 2021 04:33:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37FD28D0343; Fri, 12 Mar 2021 04:33:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 18C4A8D0317 for ; Fri, 12 Mar 2021 04:33:58 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D23F583E5 for ; Fri, 12 Mar 2021 09:33:57 +0000 (UTC) X-FDA: 77910710514.07.7A00489 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf06.hostedemail.com (Postfix) with ESMTP id AC2C8C0001EE for ; Fri, 12 Mar 2021 09:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615541636; 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=Rj53vgUL+fBc1sW2QW6DZG1JFSB+puhdylPCj8GuUxQ=; b=fFmpdRXUPejtidCoVFlwBDMIMy/i7HKvEBoTA7WYYaOXL/t6xtE2OaVaOr2/Qwx1khzMHe nw3FVtKuL38wMjG5T0QXmEO1xnToeeJwAWW4zVvxDW7LiQySO41FvfbSa5OdGa9IkjYZRz JDCP17msScBguQLvV4flP5YPPhj0220= 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-363-LQlaec_hOfOaql8j20nvfQ-1; Fri, 12 Mar 2021 04:33:53 -0500 X-MC-Unique: LQlaec_hOfOaql8j20nvfQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9087C760C1; Fri, 12 Mar 2021 09:33:51 +0000 (UTC) Received: from [10.36.114.197] (ovpn-114-197.ams2.redhat.com [10.36.114.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 595F9196E3; Fri, 12 Mar 2021 09:33:49 +0000 (UTC) From: David Hildenbrand To: Minchan Kim , Andrew Morton Cc: linux-mm , LKML , joaodias@google.com, surenb@google.com, cgoldswo@codeaurora.org, willy@infradead.org, mhocko@suse.com, vbabka@suse.cz, linux-fsdevel@vger.kernel.org References: <20210310161429.399432-1-minchan@kernel.org> <20210310161429.399432-3-minchan@kernel.org> <1bdc93e5-e5d4-f166-c467-5b94ac347857@redhat.com> Organization: Red Hat GmbH Subject: Re: [PATCH v3 3/3] mm: fs: Invalidate BH LRU during page migration Message-ID: <1527f16f-4376-a10d-4e72-041926cf38da@redhat.com> Date: Fri, 12 Mar 2021 10:33:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <1bdc93e5-e5d4-f166-c467-5b94ac347857@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Stat-Signature: fyysswsqgr3fp8zhyxwmb4oe9ampjcbs X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AC2C8C0001EE Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615541637-596865 Content-Transfer-Encoding: quoted-printable 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 12.03.21 10:03, David Hildenbrand wrote: > On 10.03.21 17:14, Minchan Kim wrote: >> ffer_head LRU caches will be pinned and thus cannot be migrated. >> This can prevent CMA allocations from succeeding, which are often used >> on platforms with co-processors (such as a DSP) that can only use >> physically contiguous memory. It can also prevent memory >> hot-unplugging from succeeding, which involves migrating at least >> MIN_MEMORY_BLOCK_SIZE bytes of memory, which ranges from 8 MiB to 1 >> GiB based on the architecture in use. >=20 > Actually, it's memory_block_size_bytes(), which can be even bigger > (IIRC, 128MiB..2 GiB on x86-64) that fails to get offlined. But that > will prevent bigger granularity (e.g., a whole DIMM) from getting unplu= gged. >=20 >> >> Correspondingly, invalidate the BH LRU caches before a migration >> starts and stop any buffer_head from being cached in the LRU caches, >> until migration has finished. >=20 > Sounds sane to me. >=20 Diving a bit into the code, I am wondering: a) Are these buffer head pages marked as movable? IOW, are they either PageLRU() or __PageMovable()? b) How do these pages end up on ZONE_MOVABLE or MIGRATE_CMA? I assume these pages come via alloc_page_buffers()->alloc_buffer_head()->kmem_cache_zalloc(GFP_NOFS |=20 __GFP_ACCOUNT) --=20 Thanks, David / dhildenb