Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6113323rdb; Mon, 18 Sep 2023 04:52:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHILz4X/gwH+NlS0aWzyMRPiT7/EJuCsG56bHAP6jZhV/fmf11k8P7DsQJ9zDVrbGQ3KZjy X-Received: by 2002:a05:6870:6127:b0:1bf:1a58:c50 with SMTP id s39-20020a056870612700b001bf1a580c50mr10951126oae.9.1695037955619; Mon, 18 Sep 2023 04:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695037955; cv=none; d=google.com; s=arc-20160816; b=QuLcoimpum3CtnxrQNWMg36YBh5id3Gt9qgmzKdxryYiROHwUBV66SJyK1grRxOTza Y1itHCfgzrED7U85M7GGIlrIhTSLs/iLQuVCVI3mIHRDcduz6+awFDR9e5COhDE1Enjf t2vCMa7MPLLbUTVoPUw7dEcE/qJyLoAwxbyYkFPbOWnocxOKV81xiF5COuOeZ+qb2WNw iS6jApUex4U/Lu8A1zOEvKulJH3IRyAUzJnvKIIJGjDZOsX1fqNf42KIoj6GISMDHzzT MxY2LkQV7EtL5WSXWzhdT5Dv2Bx/FEs1/yi8pQY8yP2q0No5zY/fAH2OL9Ecu1nNy8hR 9jzw== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=ZF/+oaEMMum4fNtySMS0TbtMv5W3qRUOaMV7CUK+Pfo=; fh=bVbXYsz7RnoWAbZ/pxbS1aS5goisULyMCZcKwISJcz4=; b=Dd3JAXkcxBmNaUnY/0h/+4L+puFVMoMdkD0LMA+UfqtohFj6VsSnldyAGXvrUBRzKM gsx1oVADsTDBIvZhsO/KWMUT2WfWqTaUEJgtrRDdZfUEliadlvId1oo6bLSgjDdNFpVf J51wQuqtwKhbn/AlAf8Z9jFbmtyBmm5U98IP+vX7qgjZyZrCQhKEDIHg5SGcA4C97zaO q9dDIAY3rYUXBR7VWO1yXiI9W3IPX7+ksC3lK/bgI9FDNbYVeGlKNAJTHzpV01BY2Frm zgCCfZcNV17szp1xDl1jLaInD5zzUAfJ23r0SLCu1l1BmzZjf3uhIiLk4llklY2gpNs7 a7Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Yo5U62H7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=iX3ePRuX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bb8-20020a17090b008800b0026b365096e5si2196569pjb.53.2023.09.18.04.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 04:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Yo5U62H7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=iX3ePRuX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6FF0F81E5D3B; Mon, 18 Sep 2023 00:08:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240004AbjIRHIF (ORCPT + 99 others); Mon, 18 Sep 2023 03:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240048AbjIRHIB (ORCPT ); Mon, 18 Sep 2023 03:08:01 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D300D2 for ; Mon, 18 Sep 2023 00:07:54 -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-out1.suse.de (Postfix) with ESMTPS id A78A521863; Mon, 18 Sep 2023 07:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1695020873; 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=ZF/+oaEMMum4fNtySMS0TbtMv5W3qRUOaMV7CUK+Pfo=; b=Yo5U62H7Mu6PomECV37NndMZV88Ny6ZXstJMoCUOBIya+np3Mh+Oug0bWLI9594d2CMUDJ beTk38Vz8U1AxQoYxLDK/VlkkkUI+1ZY6p5hxoK0l5t2jdA2Th8YWefk/ve7Vqt+auo7yD 69hmPacwFOSJdNy9nE63G8sNzvurxZo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1695020873; 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=ZF/+oaEMMum4fNtySMS0TbtMv5W3qRUOaMV7CUK+Pfo=; b=iX3ePRuXYc1H9ClVQ1O/726rnZiSMe7GURPdUYdkNbs0lk1VUPYopo7ClEK+QY1kZIep5S n+6K+nQebH/MlzBw== 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 8198E13480; Mon, 18 Sep 2023 07:07:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9ojXHkn3B2XESgAAMHmgww (envelope-from ); Mon, 18 Sep 2023 07:07:53 +0000 Message-ID: Date: Mon, 18 Sep 2023 09:07:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH V2 0/6] mm: page_alloc: freelist migratetype hygiene To: Johannes Weiner , Mike Kravetz Cc: Andrew Morton , Mel Gorman , Miaohe Lin , Kefeng Wang , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20230911195023.247694-1-hannes@cmpxchg.org> <20230914235238.GB129171@monkey> <20230915141610.GA104956@cmpxchg.org> Content-Language: en-US From: Vlastimil Babka In-Reply-To: <20230915141610.GA104956@cmpxchg.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 18 Sep 2023 00:08:43 -0700 (PDT) On 9/15/23 16:16, Johannes Weiner wrote: > On Thu, Sep 14, 2023 at 04:52:38PM -0700, Mike Kravetz wrote: >> In next-20230913, I started hitting the following BUG. Seems related >> to this series. And, if series is reverted I do not see the BUG. >> >> I can easily reproduce on a small 16G VM. kernel command line contains >> "hugetlb_free_vmemmap=on hugetlb_cma=4G". Then run the script, >> while true; do >> echo 4 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages >> echo 4 > /sys/kernel/mm/hugepages/hugepages-1048576kB/demote >> echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages >> done >> >> For the BUG below I believe it was the first (or second) 1G page creation from >> CMA that triggered: cma_alloc of 1G. >> >> Sorry, have not looked deeper into the issue. > > Thanks for the report, and sorry about the breakage! > > I was scratching my head at this: > > /* MIGRATE_ISOLATE page should not go to pcplists */ > VM_BUG_ON_PAGE(is_migrate_isolate(mt), page); > > because there is nothing in page isolation that prevents setting > MIGRATE_ISOLATE on something that's on the pcplist already. So why > didn't this trigger before already? > > Then it clicked: it used to only check the *pcpmigratetype* determined > by free_unref_page(), which of course mustn't be MIGRATE_ISOLATE. > > Pages that get isolated while *already* on the pcplist are fine, and > are handled properly: > > mt = get_pcppage_migratetype(page); > > /* MIGRATE_ISOLATE page should not go to pcplists */ > VM_BUG_ON_PAGE(is_migrate_isolate(mt), page); > > /* Pageblock could have been isolated meanwhile */ > if (unlikely(isolated_pageblocks)) > mt = get_pageblock_migratetype(page); > > So this was purely a sanity check against the pcpmigratetype cache > operations. With that gone, we can remove it. Agreed, I assume you'll fold it in 1/6 in v3.