Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6488282rwr; Tue, 2 May 2023 00:48:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6eHFqBe6ggu/8GIOV8vOASn0wKXTIn7h/yRCImcGlYIWEBAhf5ge3eycA4qRMd1yUnK5Hj X-Received: by 2002:a17:90b:1b4c:b0:233:ee67:8eb3 with SMTP id nv12-20020a17090b1b4c00b00233ee678eb3mr17039771pjb.24.1683013716531; Tue, 02 May 2023 00:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683013716; cv=none; d=google.com; s=arc-20160816; b=Vsh0WRiI3TeaLUxv1SHRHEGkBcPG7mEiVofHhUo0DkeyHdESSBx+cs/iM7tZ9/8wXZ ze2RNhkfKOT96UCMDwvFAXpgQpNfranBMYLAzwC00HbD3oAMqYSO+m8LiS99ZR83+Sgy VeWbMshuqZzhZaO96OkRXCuo6uxwR3uro4nPldYNUXLyLynj1v0FR8PBMwrB7LtUdKGY CC7+HD2xld+K62C5Q8Cfe2d9RXFO4eRLUAiiOBpJ+VYusQdSJYCwMRDziZEs+zQexHsS NFbTgvD2vL4dhHql+W67ki78L3FkKwYbQ9v6pW1QucXAQd9Xr00hZeXbCNJEcI7ekRCI NUJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=mp2p1cOI63OqchM/aYd5M0KrSgJ0E9fnfdPswaSvyVk=; b=hIslkL2/Ty6GyNq/Sk9pJe/8o+6LZReGm4jCwiuF+NCkpHipNygOTibZ/6dbWAiM4D 5/7/OI2kM/7c76ZOgEDb1tIaq4BYpc3Mzh+y+eexGw2a/oQL/jlpSjBz292NjgB96/h/ TFAfKxYRUTTieyKc/lbdLUJs7LxT2V8Y7FBEZVct5CIM/CfYCeUSs4ejAiN/dh9kRvTY K+nKc6exdvmNprnLsmtVY288JZEdbny62GZqk990q1Qe48GVs/6Dci7DmaNUH+5RaySA 07GNBhNfri+xGnrH/3c3eTgAuGwpv5kWX6FIlcrVrSAxNXDGI74bbfkrWdE3TJnpThGn Em/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=mZeUCNLL; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id on5-20020a17090b1d0500b0024c045f6bf7si14650268pjb.84.2023.05.02.00.48.19; Tue, 02 May 2023 00:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=mZeUCNLL; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233390AbjEBHpo (ORCPT + 99 others); Tue, 2 May 2023 03:45:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233167AbjEBHpm (ORCPT ); Tue, 2 May 2023 03:45:42 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE13E19BE for ; Tue, 2 May 2023 00:45:41 -0700 (PDT) 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-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.