Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp241514lqb; Tue, 4 Jun 2024 09:58:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqmDtK5goSeSmDtpYSR8alEZUyzGGtLVd3zNRSZT6LOvYeKsEdrqC67PBwCiyEIz1bB0iyGj9iC8ifaAIR9/1PnVujLuJrZ2mfITS/Eg== X-Google-Smtp-Source: AGHT+IF+Sd85zCnebdwe937+hzTGUPPQOJ0tcdx+kcI8k0CQYxbQVQHNpSb+QV6A3S0T2km3qwVs X-Received: by 2002:a05:6358:7e0f:b0:19c:6282:107 with SMTP id e5c5f4694b2df-19c6c7b1667mr527455d.17.1717520315598; Tue, 04 Jun 2024 09:58:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717520315; cv=pass; d=google.com; s=arc-20160816; b=w5O6KLhOMO7roHmrTKb8cjgiXLsdBkQdIz4IpIRL22BJX5yyD9EP/9c7TaW+VB1nQb lb/6iw2b7s60c6clOjbi37he+fxuHv25c0wk/2weXfMJXpU9svljRG5Y1dX0t4Jb87pv 6xU1IQoKlXOjnqFdU+JIhtgAoYwVw2kfvaNMNGiO93DTogdzeAbwQHOpRrWvAk2DSbO1 8lyu/0uaGBJbzj5N1sk4B1EbiuUa8Ky4mGQENyjDCLa8ST2UPApRVxUJHVdlZj4aNuIy PD1FD0Vie6mqawmRYASn+pNdNklcZF6dwDNfFhQ5Fg9a4tC+Eb3mPM0PvbavSNlRl8lW NzIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=7Fq1N08ityDodrU5UqN/tu7ksF/MqwNuqjUfkSs8E40=; fh=xqqjtk8FMQsRKAQxUMNeuTggDQv16UjKdDuaAWoS9wo=; b=OnfLAHcz9hH8D+hCm/sjRoZepAA5d9Od04CrhxKa/bBzZug79Y4C+xpjqXMvPNb+gX ZhxpcOO8uCLhtXpU+rAgK/dM9z2UJnMjyYY4Gqx8fkX+rHPq/vVZOs9ljo38mft7EgDr DRnCw3o58a91chf8ddeO8pe5ITPFlLd5HYF1FHtJGXnSGkOgBj/5aKEN3fKrc6/16EGC gVx6g2EOXX3xojMTHoIYxlZwVRq/UrgnGEr17mdnVk1L8+XRvcBAHYyxaW3W+/OnlR39 VjfSm5nO7Yw1U1RABfJUR5gT3oZLzxLrnIWnPeLZR1eP9sCiIPOPO0hfwxYm7aVZQ9hz UbXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uSMeGsvM; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-201047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3542e3b4bsi1410152a12.172.2024.06.04.09.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uSMeGsvM; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-201047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C77BCB22595 for ; Tue, 4 Jun 2024 16:12:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9AD2146D71; Tue, 4 Jun 2024 16:12:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uSMeGsvM" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50E3953BE for ; Tue, 4 Jun 2024 16:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717517524; cv=none; b=KQFAEJjYauSUGZrMJrFHvBG+F9mz1XS+gZNVUV8NLjZRAztEaqC0GJgp2BfttnvfX42BI20vBWbTZe0AupblioS0bMA9jHXwEA/ylbTE/evQvnIjRbi4orAsuGlQDZTMPe5uWIAuMPwTRRqUNIFvMk+5YhzUIONhmzL4K9LOda4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717517524; c=relaxed/simple; bh=7Fq1N08ityDodrU5UqN/tu7ksF/MqwNuqjUfkSs8E40=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=iOosMC/IGTQ5IIP7PHgQTY4qlvm2MYan6Zdrl0HZZ2wDfkRh0xN8GZ3hs40DNVUOvsznL6/CfLQST1gXUivi511bflXi7MVzNqJuavlpAa2OK6kEcXG4+ijnXj+INqNBneY2zUHVRvqdTBrqnDtGH+QuiAY6le3xUzChb15n9cU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uSMeGsvM; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a691bbb7031so285998066b.1 for ; Tue, 04 Jun 2024 09:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717517521; x=1718122321; 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=7Fq1N08ityDodrU5UqN/tu7ksF/MqwNuqjUfkSs8E40=; b=uSMeGsvM7jgvY5nWrRDZwOyjEIR8CZB/fK7gNLbc6T2lF4lqhIr4QKURrMC9SSEryQ KNif1hDTB2NnAvh0XNT7DYt8fSQNcHPQQBfLPrk/RSLAEQoHyGNWsUWNEeiOMwSRSwIY iji2HedoKLoKrVt9MpRQnRwSI3++RqiQQjkbVXjRZLKpm+yxZYVYN8FfS1wy6KVmg+dI TlHfPV6Bky01ptwNR6jpWz8+gRLrAmfLfD8E6wCwat2zlbRGH4FzLbaAgEAxKnZCFHEY 0NyTF3TyPWc6fbhyN5DkpEd8HSeKte6QbR5wxCUhSbHrwYHP2ytVabvowUx30maOZ8ea VUsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717517521; x=1718122321; 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=7Fq1N08ityDodrU5UqN/tu7ksF/MqwNuqjUfkSs8E40=; b=fmdGSYWnF5aI723EQHZCDKW4Cr/BgRv7gL8t3A9kRLSbHaVU299iTNpmsGWksHpmvW yrW6r/4XdIKLdvk+BpQ6NGh4XtEHT7RnMnA0bLq75z5U7tA7OgSIUuNOtet57JGUDRkZ HSzMiueiSZYox2lUsLYzW2xjzqIuzbAjzHw1uGvRJmS310Mm67K8o0o8SHjxHI94CNis UimaEH4y2GZcr1R5XK17fuR+hqnTeRj0Xf3+uMwmpPpW60lXg6OBJBWHtFMvznr7lect Mtl1P7QsuKu8sCng7lRv3y+MyrcunyYsUk01EOoHWF86UGBGYaj4XW4ea1oUGTLutz4j CbzQ== X-Forwarded-Encrypted: i=1; AJvYcCWAC0uwY3KpRdY1w4qfBRo/deZImHAM9WpWhxEwqUSbY6e9daV8AwPrEjIWS20xeh8a1j4nnHip36j9l92U992M03gWh6bu5xAeVQVR X-Gm-Message-State: AOJu0Yz849DHnvCfdVFpzKQfVKFJU2W8oD4Qt09RCwKIXppdS7+pvJ6S FLP7MOLyLOqsOT536Hr7WmGUzDJAt2fJplDB1Bhm3/Dm6lSTd8oyStya3HMhRAUTOZrRyGlp+RB TswaiqBQWKWaT5GYv0ohzDshQheNnvDQF2xe/4CgYAejRxCfrklCu X-Received: by 2002:a17:906:35da:b0:a59:d2ac:3856 with SMTP id a640c23a62f3a-a699f66643bmr380966b.22.1717517520321; Tue, 04 Jun 2024 09:12:00 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240508202111.768b7a4d@yea> <20240515224524.1c8befbe@yea> <20240602200332.3e531ff1@yea> <20240604001304.5420284f@yea> <20240604134458.3ae4396a@yea> In-Reply-To: <20240604134458.3ae4396a@yea> From: Yosry Ahmed Date: Tue, 4 Jun 2024 09:11:21 -0700 Message-ID: Subject: Re: kswapd0: page allocation failure: order:0, mode:0x820(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0 (Kernel v6.5.9, 32bit ppc) To: Erhard Furtner Cc: Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Johannes Weiner , Nhat Pham , Chengming Zhou , Sergey Senozhatsky , Minchan Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 4, 2024 at 4:45=E2=80=AFAM Erhard Furtner wrote: > > On Mon, 3 Jun 2024 16:24:02 -0700 > Yosry Ahmed wrote: > > > Thanks for bisecting. Taking a look at the thread, it seems like you > > have a very limited area of memory to allocate kernel memory from. One > > possible reason why that commit can cause an issue is because we will > > have multiple instances of the zsmalloc slab caches 'zspage' and > > 'zs_handle', which may contribute to fragmentation in slab memory. > > > > Do you have /proc/slabinfo from a good and a bad run by any chance? > > > > Also, could you check if the attached patch helps? It makes sure that > > even when we use multiple zsmalloc zpools, we will use a single slab > > cache of each type. > > Thanks for looking into this! I got you 'cat /proc/slabinfo' from a good = HEAD, from a bad HEAD and from the bad HEAD + your patch applied. > > Good was 6be3601517d90b728095d70c14f3a04b9adcb166, bad was b8cf32dc6e8c75= b712cbf638e0fd210101c22f17 which I got both from my bisect.log. I got the s= labinfo shortly after boot and a 2nd time shortly before the OOM or the ksw= apd0: page allocation failure happens. I terminated the workload (stress-ng= --vm 2 --vm-bytes 1930M --verify -v) manually shortly before the 2 GiB RAM= exhausted and got the slabinfo then. > > The patch applied to git b8cf32dc6e8c75b712cbf638e0fd210101c22f17 unfortu= nately didn't make a difference, I got the kswapd0: page allocation failure= nevertheless. Thanks for trying this out. The patch reduces the amount of wasted memory due to the 'zs_handle' and 'zspage' caches by an order of magnitude, but it was a small number to begin with (~250K). I cannot think of other reasons why having multiple zsmalloc pools will end up using more memory in the 0.25GB zone that the kernel allocations can be made from. The number of zpools can be made configurable or determined at runtime by the size of the machine, but I don't want to do this without understanding the problem here first. Adding other zswap and zsmalloc folks in case they have any ideas. > > Regards, > Erhard