Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp231574rdg; Thu, 12 Oct 2023 04:16:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAXCu636ZMfvKTs2JbhvlLbYCe7jLYWz+v6l5Ht0hmFz4Q5MwQbW0MhsNzOFli/vgV1yFh X-Received: by 2002:a05:6a00:22ca:b0:690:454a:dc7b with SMTP id f10-20020a056a0022ca00b00690454adc7bmr26755025pfj.28.1697109360593; Thu, 12 Oct 2023 04:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697109360; cv=none; d=google.com; s=arc-20160816; b=CvQLXD01I1O9QA9rWvcSMZaWm+qpRT5QjBCC45nNE4HBA5ZiNJBr7RWQjRqzJIqNQJ tbeuv9FlZH6AmA0/7wdb0emienLr8RfEitjoiL+u2uCDxyCeKKg+AwO/7E+4cS35Ii6c 8B/z5O3iMiGkDD8XsBrDiFy5pB5OAUdvFPev4EgwBPKheudlrWGHFU8JAnXuKbQJX9Iy /Ynw/QkNtK659YHvxfJ2B20TohdIhxiIo/oHhXgZjQM9miZOIhc3bDvOb6obr69Ky/PG yIQqf1FxnFj5WWe/2snwnpLdmYsq5cj/e3OTs7Hd6Bx7ISiwdnalc8WqcKFfk9VyEjsp ggwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=y911gpikiKBoVvk2OZa8oqIqP+/8W07F+urby0JQ3ZM=; fh=hF8zjfzkyQhUewlXxwVoibpiF3db4bGfF6ztKBQXOQA=; b=s1mN4V/YDCyXKheDOmKtMv/FGt9K8reWEb7JFwo/dEGmsSDgtwFdvSn0FsGJS2o9uz RqSSTMIr/xQorey2BBZnhCGpk7TiaVWjFj35aOPtv8HxovW6nNZOhN1ycoDmmDUzL+B9 erRh4g9p0bFSJKO+tpEtmxwBgRaZHpOsukV299fADrgGLG8pSd7wGxMwalJ74bJI2VcH Ku3AsmLP5aNR8My9lMKHhw9qisV5ItRlYlwsnPIWKOZ1EAzw9umTpjQIELq3CidllkhS kEMQQ4n1LzTOwBcrgSySpo1r33tJl1VCPc7jewSXR6oPdXpGoZfa4SCw1fIJM+ddk6nY vKFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=X+3Je67I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f23-20020a635557000000b00585ad175170si1983003pgm.69.2023.10.12.04.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:16:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=X+3Je67I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B8F9E806B07D; Thu, 12 Oct 2023 04:15:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378284AbjJLLP2 (ORCPT + 99 others); Thu, 12 Oct 2023 07:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378207AbjJLLPZ (ORCPT ); Thu, 12 Oct 2023 07:15:25 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B05AB94 for ; Thu, 12 Oct 2023 04:15:20 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-d81dd7d76e0so856763276.1 for ; Thu, 12 Oct 2023 04:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697109320; x=1697714120; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=y911gpikiKBoVvk2OZa8oqIqP+/8W07F+urby0JQ3ZM=; b=X+3Je67IoP8WDkBg9T8C+ZQ+oii8wzOe+uDykVttTCFi1z2Acyf5R4Doc3Jo3lIaoK HqVUg5ZHPYIMOVWWnisdKIOuqlmKkvyF5vXJNhwyaF/f56oX4qkfylChDpHQmEpWQmwS 6Qea5aiLl2pVXGOJVXbdZlNd4wc3n/N9Boz6l5i2YrEBtP8GqIwvqUK3WT278jR84Ppg g4aUzSddXLp3VI3M8gXYCesZgijC/9PU9lDOh6bur8MF107Ou2KKWVEXDcZge0AJmgjw ANiixgiTMQLiyp74lAhMYUeR5bRqrZUs/+Kdyui1AfrItMRVdxtOgXl5RLCWe6gVzsky I44Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697109320; x=1697714120; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y911gpikiKBoVvk2OZa8oqIqP+/8W07F+urby0JQ3ZM=; b=KNxHXzgBP7QQ+NGe2MKUlZzTJKaKdoCvumTzR3Ez0jkWPXvgkDbPszztJpNrLwEjgX ajuM+6cx0mScGaTbbF3REVAy6MO4Zef21FLut7sG13LbEF3w/s8S38drAit9bAMRhLyR jZSPYKutxTjfwljr/FjBy+f5GPXkpuH/LGDWMi7YU8Nbv2yY4PxZzbhcGuyGp/OMw/c6 fGwgGeU6//6CE5gWkZl2iNb8dtaMlARco8iQV0EASU8KuuSluKxStWLQajV/vcWIBoVz J2ftn9A0xJlucvzr8s6hRi1jDk+HXZ9Jwx8Q0foU05E/RO3O0V0EVor7xfOdl+utILyt Xdaw== X-Gm-Message-State: AOJu0YyPSEL3yai5iSU4tc4w2jIdtihzNzt/0RjYNWB4C906e9D8UXK0 LHi3m/2klN572Tv1KokKDq5d6uQcm43OHyS0laXlYg== X-Received: by 2002:a25:ef4a:0:b0:d9a:be04:7faf with SMTP id w10-20020a25ef4a000000b00d9abe047fafmr1804514ybm.9.1697109319751; Thu, 12 Oct 2023 04:15:19 -0700 (PDT) MIME-Version: 1.0 References: <2023101238-greasily-reiterate-aafc@gregkh> <2023101201-grasp-smartly-2085@gregkh> <2023101241-old-germinate-7a05@gregkh> In-Reply-To: <2023101241-old-germinate-7a05@gregkh> From: Alexander Potapenko Date: Thu, 12 Oct 2023 13:14:39 +0200 Message-ID: Subject: Re: [PATCH] lib/test_meminit: fix off-by-one error in test_pages() To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Andrew Donnellan , Xiaoke Wang , stable@vger.kernel.org, Andrew Morton , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:15:48 -0700 (PDT) On Thu, Oct 12, 2023 at 12:37=E2=80=AFPM 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=E2=80=AFAM Greg Kroah-Hartman > > > wrote: > > > > > > > > In commit efb78fa86e95 ("lib/test_meminit: allocate pages up to ord= er > > > > MAX_ORDER"), the loop for testing pages is set to "<=3D MAX_ORDER" = which > > > > causes crashes in systems when run. Fix this to "< MAX_ORDER" to f= ix > > > > 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/23baf831a32c04f9a968812511540b1b3e= 648bf5 Older kernel versions had an explicit check for order >=3D MAX_ORDER, which is what you're seeing on Android.