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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 014B7C77B73 for ; Tue, 2 May 2023 16:05:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76A596B0074; Tue, 2 May 2023 12:05:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71A356B0075; Tue, 2 May 2023 12:05:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60880900002; Tue, 2 May 2023 12:05:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by kanga.kvack.org (Postfix) with ESMTP id 3E8046B0074 for ; Tue, 2 May 2023 12:05:36 -0400 (EDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7F1B11F8AA; Tue, 2 May 2023 07:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683013540; h=from:from:reply-to: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=mp2p1cOI63OqchM/aYd5M0KrSgJ0E9fnfdPswaSvyVk=; b=mZeUCNLL5WSw5Mw9Gna0+yIl1brHiZkMYIaS3PVcpVxr/sUWHKBWqOqyUhGS8dT4QSXFNx t4U+eEN2IszKHcXwn9ajxzKAl5fOglKjjkIeXZthQuTrmev6+ohk18mUMFBemkGjSHBJq6 8ploAZSEiHbnCx0O8cpUwKEWEScWZBg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683013540; h=from:from:reply-to: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=mp2p1cOI63OqchM/aYd5M0KrSgJ0E9fnfdPswaSvyVk=; b=KpwUJz+U8P4RFXMfSD4hrusKRHsN/4b8K0yeVVrPhPtZR5FIePpWHEdGszvRHZjxC0P5op m2qBw0atezlemrDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 672ED139C3; Tue, 2 May 2023 07:45:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Q3aDGKS/UGQvGwAAMHmgww (envelope-from ); Tue, 02 May 2023 07:45:40 +0000 Message-ID: Date: Tue, 2 May 2023 09:45:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: mbind MPOL_INTERLEAVE existing pages Content-Language: en-US To: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Michal Hocko , Lorenzo Stoakes References: <20230501185836.GA85110@monkey> From: Vlastimil Babka In-Reply-To: <20230501185836.GA85110@monkey> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 5/1/23 20:58, Mike Kravetz wrote: > I received a question from a customer that was trying to move pages via > the mbind system call. In this specific case, the system had two nodes > and all pages in the range were already present on node 0. They then > called mbind with mode MPOL_INTERLEAVE and the MPOL_MF_MOVE_ALL flag. Their > expectation was that half the pages in the range would be moved to node 1 > in an interleaved pattern. > > In the above situation, no pages actually get moved. This is because mbind > creates a list of pages to be moved via: > > ret = queue_pages_range(mm, start, end, nmask, > flags | MPOL_MF_INVERT, &pagelist); > > No page will be added to the list as queue_folio_required is called for each > page to determine if it resides within the set of nodes. And, all page are > within the set. > > I have reread the mbind man page several times and agree that one might > expect MPOL_INTERLEAVE with MPOL_MF_MOVE_ALL to move pages and create an > interleaved pattern. My question is should we: > - Change mbind so that pages are moved to an interleaved pattern? I guess it could be worth trying, if there's a use case. And hope nobody else is depending on the current behavior and will complain afterwards :) > - Update the documentation to be more explicit? > > I can do either, but just wanted to get opinions before starting.