Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp236112rdg; Thu, 12 Oct 2023 04:24:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG95z4k95e9+RpfU1rXHupSCCIHsQuXkplvf1Bk14CmWpuwEh4TFg/5AbmeqnZLtHFGeWXB X-Received: by 2002:a05:6a00:b84:b0:68f:ccea:8e14 with SMTP id g4-20020a056a000b8400b0068fccea8e14mr26037883pfj.32.1697109870801; Thu, 12 Oct 2023 04:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697109870; cv=none; d=google.com; s=arc-20160816; b=spcFbueriVb0DMcbnwWPqqRRg62WvjW2w2Ifr9e5XOeKu0o0UhdYy0ay/cLEG++Zco bSBU5a3bapqUPGqch4tp7o754sqxWEEF+C+wEsrs7QhoFkfG79PjCv4vII7OQ3jH0kJ+ XF/ByFzklydxFd5Vq2zbJu6QRuuyOibdkSfZL6hAXVcYGZ15oD0t2A01NdN956jtgddm m2gx3rrm43b/X/Zt2Fz22QjJbVJBr/d0v5uRhHWBy/cKbZQjZEGP99hBC9dSaGvCDHqP opUv3Q28+B/kfk7K6Z0JL6IL6A5Nfdeul28CLrTlNg5yPyoegzCdMHPBiRgtfyTfZzYB 8hDw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=P7oUDWq7xFYsUEXIaXjZQgHanDnD1Af3SgpiAEPa5nA=; fh=+ieevofufklWfgCCArK3td+luCymoHjdcCyeoMuSir8=; b=geujP7ZMjXBpV7WO5vbUXLVspvEqI57s84W6nDmZ7PjtbB/YCqYRr7O7feZuWr/mY2 LBPQXqAo9NC7odYsK88fMuVK+sVWGOFaaBylUtsxuJtdCeL5Xi5wRbWfTDidoHDEUqkL YDtJcgCnShZqWoLkabj/w422veIyBZ0gzSz1khShoc6UwsmLM91acoHOnLtHhBKjiwr7 7aho8m0NYktFa9dLpF3N5ugBeAKA6HOrjtVakeq5rAIuxgdUYtWvCMUD3aydA/GVwS8J iOCNeZuSe2jIDPexcaUUM1w2e5pqNU+B5pQxK4yV0Wse33lFfsd8w8UU3KxWUV/GO+pn q2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X93lfslP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bw41-20020a056a0204a900b005849dc13e74si2252045pgb.56.2023.10.12.04.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:24:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X93lfslP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D16948068222; Thu, 12 Oct 2023 04:24:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378062AbjJLLYI (ORCPT + 99 others); Thu, 12 Oct 2023 07:24:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343789AbjJLLYG (ORCPT ); Thu, 12 Oct 2023 07:24:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8929B91; Thu, 12 Oct 2023 04:24:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B28BCC433C7; Thu, 12 Oct 2023 11:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697109844; bh=xcGFBX4K3u3hA6pR8kKm1S21DpL9l6KVTqZCKLMel1Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X93lfslPnVsgcUE9NA9cH6EMBdskLpoVmO7TKXQr7NvC/pQHKkbbFjMhxFtYztnmJ N85hkGoUAXNpZsvWKRV43cGwv6mIcHTKxsbE2FAvShOA6u1+c/pXUnz0fP7IC71T5y 4SyfhJt7DHukUPbSD+/DrgC65KSzWMFPA524g7ac= Date: Thu, 12 Oct 2023 13:24:01 +0200 From: Greg Kroah-Hartman To: Alexander Potapenko Cc: linux-kernel@vger.kernel.org, Andrew Donnellan , Xiaoke Wang , stable@vger.kernel.org, Andrew Morton , "Kirill A. Shutemov" Subject: Re: [PATCH] lib/test_meminit: fix off-by-one error in test_pages() Message-ID: <2023101218-whacking-evolution-8f97@gregkh> References: <2023101238-greasily-reiterate-aafc@gregkh> <2023101201-grasp-smartly-2085@gregkh> <2023101241-old-germinate-7a05@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:24:27 -0700 (PDT) On Thu, Oct 12, 2023 at 01:14:39PM +0200, Alexander Potapenko wrote: > On Thu, Oct 12, 2023 at 12:37 PM Greg Kroah-Hartman > wrote: > > > > On Thu, Oct 12, 2023 at 12:26:58PM +0200, Greg Kroah-Hartman wrote: > > > On Thu, Oct 12, 2023 at 10:40:14AM +0200, Alexander Potapenko wrote: > > > > On Thu, Oct 12, 2023 at 10:17 AM Greg Kroah-Hartman > > > > wrote: > > > > > > > > > > In commit efb78fa86e95 ("lib/test_meminit: allocate pages up to order > > > > > MAX_ORDER"), the loop for testing pages is set to "<= MAX_ORDER" which > > > > > causes crashes in systems when run. Fix this to "< MAX_ORDER" to fix > > > > > the test to work properly. > > > > > > > > What are the crashes you are seeing? Are those OOMs? > > > > > > They are WARN_ON() triggers. They are burried in the Android build > > > system, let me see if I can uncover them. > > > > > > > IIUC it should be valid to allocate with MAX_ORDER. > > > > > > "should", but I no longer get runtime warnings with this patch applied, > > > so something is wrong :) > > I think I know what's going on. In March 2023 Kirill changed the > semantics of MAX_ORDER to be inclusive: now alloc_pages() accepts > 0..MAX_ORDER, whereas previously it was 0..MAX_ORDER-1: > https://github.com/torvalds/linux/commit/23baf831a32c04f9a968812511540b1b3e648bf5 > Older kernel versions had an explicit check for order >= MAX_ORDER, > which is what you're seeing on Android. Thanks for digging this up. I'll just queue this patch up for 6.1 and older stable kernels then as the commit above you found is in 6.4 so nothing newer than that will need this fix. Thanks for the quick response! greg k-h