Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp139177rdb; Mon, 18 Sep 2023 10:18:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuLgickGdsqh6wuXxdKJmoPo9N83nI4RyzZI1/bU+tY3OXVDgN5LJaCsHxdv9oVgKBnHUa X-Received: by 2002:a05:6808:2a68:b0:3a7:72e2:f6be with SMTP id fu8-20020a0568082a6800b003a772e2f6bemr8636448oib.2.1695057488474; Mon, 18 Sep 2023 10:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695057488; cv=none; d=google.com; s=arc-20160816; b=D3M7ti1YUNkcG7dfAen27DE/u74S2yvRtDCWq45uYuhMdoqSKIOYwqWg3HvCpp0tdj /vlz4Ttz2VAdIggboXjCm5/OysWEDt7gcDm8zFz1YRsl3bUaUzaRO+25Q1FHUDB0DXdW gy5UrOCsID7JSes8CNY8ex381qvN/IDp9LjEufwfp+9IwSevnWWE0oE3cuzuf3pmngJg E5GN6BGYM9XCLqE1ip7mMz3lOBfHoyteDas7I26TgIMxVbJIFmQVcKWRXWIOLZMi3Fpb 69+ujaELXkmgAQMLuS4BUNl+KeWD0XFQPO6XIB6hGLcE1XTHp8+x+7OpeC9ex4qhjlE/ 1HbA== 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; bh=2GTC80Nmc9O9nGkpxSmWalzng5ADPOisHNrRaMTEl0U=; fh=ZpHpZlXabuJAi1OF9abAdZhLEMDQKHlRYNRK1oFGpKE=; b=izOs+6ol6+6cAXNs1fgotoL4niwS1AVV1edJU+j5GIJW1x2gTP4e0tUas1atO3b7ts DBF8fwPmcMDvPdRWZqut2c7MxsStUCUMmIsK1rL8ZveoIS0WxMFxKFfw6ImYyFv/qWJp 1JWTLwadZZvaCMIdgO99SzWpNHeCk/HklFyVS2BspZbWnYJXQ9Je7YcHME4yZc/Uxj06 3IstQQI2OtCbSqbdeABZW333GXHl7Nrfl8VuCXFjoQXA538h2o1cFGIuJ0IolV337nwZ HcuPW70bc4OCfIbSS22keCMue2qc01iBR8qaulveBzhSIVZ4jlUxKnFPsUZ+HXed6ImP F0gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=MS9bOKft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i191-20020a6387c8000000b00553c2f85095si8121321pge.832.2023.09.18.10.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 10:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=MS9bOKft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6E38D82DAD39; Mon, 18 Sep 2023 09:04:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbjIRQEY (ORCPT + 99 others); Mon, 18 Sep 2023 12:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjIRQEM (ORCPT ); Mon, 18 Sep 2023 12:04:12 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A4A046BB for ; Mon, 18 Sep 2023 09:01:41 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-76de9c23e5cso304917085a.3 for ; Mon, 18 Sep 2023 09:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1695052663; x=1695657463; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2GTC80Nmc9O9nGkpxSmWalzng5ADPOisHNrRaMTEl0U=; b=MS9bOKftSk9xrPy6zjJd6TQ6HbGEpzkwEsD8x7w0faXqOsjAsFK/XmjHwMAoE8f5x/ 7aoMl/GXRaG/6a/cpd5JO3Bd1BveXkTSGwGSVs+IbcjWvtRMnkQDhLIpHG8xkfuEqZDu xuXaZsw7z2GJ4Dttt63wypPICZ5Jgun0QMGcBoeinu5nx6SpDxIHZ1RBS+T0KZlr/g7q Dy2UKm+dGYzZoyqe2cugusAS4De18Eqz37YP8OYBEDE2oisQy2q0g26FhsVt31oZARfo zis14E66Prw3jMN5wNC2YtQktgE6tElF0XOq54wJ8CC3SBx9fcZgrV10yMB5SudBrwuE bilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695052663; x=1695657463; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2GTC80Nmc9O9nGkpxSmWalzng5ADPOisHNrRaMTEl0U=; b=iSEXIkHyX9Hc7hQssch3RBFChCl80IPZ6cIefg4WYCW5n2q2wSP5wJhcG1FsVeS4Xo ojEHZkrtJ8uKmuhppWk8blC6ZDePajYIqOdAw44wxhXphPuy8js8Jiud0XLjY2Tzl/dl U50FJlerIrYhQAb+4eo7EgsyfTxIanO18dknAOvGLw8RI2Ll1RxNSUQeCO/ARgZqO3FT nyFXd9moC2kq/1lpT0xyIHSoj2n4XT+qSghAhObebfTPOmHU+wfEU4/sQ/CFOy0G05uA NqpGa+hyHV+5JfyUYrj1AAY+yQEWjes2A9s/mH43X1DP7pJ5V6h8exs19rkEAglXit5O NvhA== X-Gm-Message-State: AOJu0YyYEaZqfKif8Rjup2ZjQYbI70/DAVc4gwbXBuKXd9OLNKw+L6+Q td5+D/x+/eHr1cAbhpOsiys96BPx19VR3XH4QdM= X-Received: by 2002:a0c:f412:0:b0:656:5199:77a9 with SMTP id h18-20020a0cf412000000b00656519977a9mr5256999qvl.28.1695046141970; Mon, 18 Sep 2023 07:09:01 -0700 (PDT) Received: from localhost (2603-7000-0c01-2716-3012-16a2-6bc2-2937.res6.spectrum.com. [2603:7000:c01:2716:3012:16a2:6bc2:2937]) by smtp.gmail.com with ESMTPSA id g28-20020a0caadc000000b0064d6a81e4d4sm896666qvb.113.2023.09.18.07.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 07:09:01 -0700 (PDT) Date: Mon, 18 Sep 2023 10:09:00 -0400 From: Johannes Weiner To: Vlastimil Babka Cc: Mike Kravetz , Andrew Morton , Mel Gorman , Miaohe Lin , Kefeng Wang , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 0/6] mm: page_alloc: freelist migratetype hygiene Message-ID: <20230918140900.GA16104@cmpxchg.org> References: <20230911195023.247694-1-hannes@cmpxchg.org> <20230914235238.GB129171@monkey> <20230915141610.GA104956@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 09:04:27 -0700 (PDT) On Mon, Sep 18, 2023 at 09:07:53AM +0200, Vlastimil Babka wrote: > 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. Yes, will do.