Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1521526pxb; Wed, 2 Feb 2022 06:52:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhud4EBVDeybhfNd2tuG6XzjKR9sd4JZB0QksZh/Peg5l9ByaeHSFzEhc4wO4SrRtDpZR5 X-Received: by 2002:a17:906:7f90:: with SMTP id f16mr25350570ejr.387.1643813570267; Wed, 02 Feb 2022 06:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643813570; cv=none; d=google.com; s=arc-20160816; b=ieZVIE+aL42zS2NltOPoLe1notB0SPm1xxFN81LQe35pOTcMMgv+bgXqspjzGym7dZ bX2hGf+GXl8hy3jp/JTdapv9RZLluZ52X63cLGu7dRuT21UDQKLSERGMj4OTyoSEwoQn cwbJ3aS/A5iT7NEAAlNQ7QUeL8goX46apCFn8/gcFgr6IQ6V4IDw8zlbn3PxNQwx6+CS pNsKhIiaoLBJmd43ySl/HnxhYt7izCIY+XHLTkBMN/+zE4xijduTDFmQHOzgQXL/vZQh BkEhxsS6QjH+sO63kIfxpdvJMwfATx5yvs3hOReMRC7Zj3dDWtRcd6Ddvt3go/3RyPDg +/ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=dyPSpPed0+9M2XwlKQxCWeOGFdixxutcj0lTKCCpUgE=; b=zHKovUBfrDtQWGoL2AHFedJhi4PJqnk1GTrz1mt9LE4+W/wv2ZfccjHXRm2DJle6U+ R4DESw12XEak+Ufum2ZHLDoFltY43RJy0RRdbMDdw3jfuRLiWXd82k6VgSkCdrbkYljY ut3SJghaOIDphZqHJxyGof9Ck+eCPtHMhnm+3wm21XrVPs3skpQfCTixj/I9f+0hZ10y 2KLJRedjG3A2e0ln7Gik1JSxoPq0ygu/ohj47lsjZ0cq03dS2vl+8tR95qsjAbZ54Vto GseURrYsIFrvz4G5Q9Nv9HQ0YhhBzCq3W6g0Vm8tBWyXW/CgqlLp3bdn1+2mLEX6FuNE BWIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=u76Vu7FI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=s2082Jsn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ee25si3373122edb.656.2022.02.02.06.52.25; Wed, 02 Feb 2022 06:52:50 -0800 (PST) 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.de header.s=susede2_rsa header.b=u76Vu7FI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=s2082Jsn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344086AbiBBMTC (ORCPT + 99 others); Wed, 2 Feb 2022 07:19:02 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:51044 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238493AbiBBMS6 (ORCPT ); Wed, 2 Feb 2022 07:18:58 -0500 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-out1.suse.de (Postfix) with ESMTPS id AF82C210F6; Wed, 2 Feb 2022 12:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643804337; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dyPSpPed0+9M2XwlKQxCWeOGFdixxutcj0lTKCCpUgE=; b=u76Vu7FI2iLzLD3FOVgP2Vix8282DDpGEUlqFJuJoAb7GsoqZiiQsX/AprPIwhS/GWi56p hD+5Ugm1z+vcC2tF3t7VCAeaDd4J+dj0QTX3rdLFl2N7ndUKlhA7S+LDyQ54YGDmYJubxZ g1MR8ScpZe9y57RPNVrdPTNnYe+HjjY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643804337; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dyPSpPed0+9M2XwlKQxCWeOGFdixxutcj0lTKCCpUgE=; b=s2082Jsn9mldjm1PkVxfSrWcQSpPxDldSrSOzFSMI7rwrn/600G2/luQBlMLKmomZx067+ PsS1l+MmKwK7JVAA== 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 4142913E18; Wed, 2 Feb 2022 12:18:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4KsvDLB2+mElIgAAMHmgww (envelope-from ); Wed, 02 Feb 2022 12:18:56 +0000 Date: Wed, 2 Feb 2022 13:18:54 +0100 From: Oscar Salvador To: Zi Yan Cc: David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michael Ellerman , Christoph Hellwig , Marek Szyprowski , Robin Murphy , linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, Vlastimil Babka , Mel Gorman , Eric Ren Subject: Re: [PATCH v4 3/7] mm: page_isolation: check specified range for unmovable pages Message-ID: References: <20220119190623.1029355-1-zi.yan@sent.com> <20220119190623.1029355-4-zi.yan@sent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220119190623.1029355-4-zi.yan@sent.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 02:06:19PM -0500, Zi Yan wrote: > From: Zi Yan > > Enable set_migratetype_isolate() to check specified sub-range for > unmovable pages during isolation. Page isolation is done > at max(MAX_ORDER_NR_PAEGS, pageblock_nr_pages) granularity, but not all > pages within that granularity are intended to be isolated. For example, > alloc_contig_range(), which uses page isolation, allows ranges without > alignment. This commit makes unmovable page check only look for > interesting pages, so that page isolation can succeed for any > non-overlapping ranges. Another thing that came to my mind. Prior to this patch, has_unmovable_pages() was checking on pageblock granularity, starting at pfn#0 of the pageblock. With this patch, you no longer check on pageblock granularity, which means you might isolate a pageblock, but some pages that sneaked in might actually be unmovable. E.g: Let's say you have a pageblock that spans (pfn#512,pfn#1024), and you pass alloc_contig_range() (pfn#514,pfn#1024). has_unmovable_pages() will start checking the pageblock at pfn#514, and so it will mis pfn#512 and pfn#513. Isn't that a problem, if those pfn turn out to be actually unmovable? -- Oscar Salvador SUSE Labs