Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp224886lqc; Thu, 29 Feb 2024 15:51:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtFlq5CVwHySVF7EXjiaZb2GoPtrPwz8tP5ZM6tEbCrTX9dvYRmfGC0eDZDErBlhR0FFhv5PoyzUObfrGMOzvLRrReZRglpPcEWF3jeQ== X-Google-Smtp-Source: AGHT+IH54qH4avZtA90JPNvRlH1bdceHlm2+RnbS+fIES1SBiEeaGhrNEdH++LSxI1PTuLvMTw4I X-Received: by 2002:a17:902:a384:b0:1d9:167b:8e6c with SMTP id x4-20020a170902a38400b001d9167b8e6cmr46261pla.46.1709250706376; Thu, 29 Feb 2024 15:51:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709250706; cv=pass; d=google.com; s=arc-20160816; b=PENtYA0PPmtUuE2YcAsK5L0hOwPuzG7BWmi1o7IsHkbU92+mA4Wme8EaLEfN/2qe+5 zGkMxCRJqGQY2XctD6KQRfeCZVkO4mkxb/O6sxsgVigYLQH9UhrdQcDQXZSCAzt0YCcL LpKzuPkv5XWa5XBtx1ov0fnBX7kwaOQcOr5hVmkgQhlPtKKQcOthB1B89qZAyMnX2xb+ pvVmj9WmC+Fk5NhLTAd1mMpZREcx8X7Is+satQauotUTfZLg2r4qz+D1R9i/Zf79oNzs mJnCvFnyTi0u/tPXHCSDY9k3ZgNMuvcCJrHWjcEidEf9i/LcU7GNUslGK3ohI4f1sEwr MC0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=wGdhmGNHVTXKtr8Coxlis0Li3Bk52TXuxtZPxJDknj4=; fh=UsQpSfeNm2zvnvgj83Iu1E9Wp/884b5vJJ8Q1oUUsOM=; b=V3G/0L6NpeOnRVH5DehPjooJfpGC3QHOyc1/Nza+eFtFDYF8ZnBPQ6RhX6fq/E6qDg JH9FOq4h54A0ZZDhqYRGWephW44hLsV8Za3WoMy1tcZ6imvA7MTTqIZ5CR9FXWuIV1yY Wn88nNxObZiCnTz6K2AeC8HUj3cM3Aea1d++gmXKBvmBtXIG4ft0+GWsNup5fF6SAaPf KCisWp7eWpWebg3ibvL57BipoR9Vayx3sB8IjO5uOP3H3UxH8Vt6YlGkmxcwFI8+BpVl xygEAbFJT0uMk96kQkunKxMuWsqfM1m9pQe3X4hpm10JqqCEXkGH8ap7yqXeY8r8m7FJ OIsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ShtDbs5l; arc=pass (i=1 spf=pass spfdomain=flex--axelrasmussen.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-87709-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f5-20020a170902ce8500b001d8d18196b9si2339295plg.404.2024.02.29.15.51.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:51:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87709-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ShtDbs5l; arc=pass (i=1 spf=pass spfdomain=flex--axelrasmussen.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-87709-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87709-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 05FBD285F0A for ; Thu, 29 Feb 2024 23:51:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCD6713441C; Thu, 29 Feb 2024 23:51:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ShtDbs5l" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 7E154137763 for ; Thu, 29 Feb 2024 23:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709250697; cv=none; b=uEjG6KHHpJiiwcMxRn6c0t76IECrUznBO+WRosmLdmA0cGz13DwWJgbnn08SfxMOm8jzZZvY/tNg5uuuYTICU3Darv6OW5kaptC55JsV7pI7wOcBAv0dCjwpTBhZhtv9/1pHwTWZrY/4DVMF7p0c/FmLONEE7bIrU4nCSnXPECM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709250697; c=relaxed/simple; bh=wGdhmGNHVTXKtr8Coxlis0Li3Bk52TXuxtZPxJDknj4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hC37h5EiMkl48mFK/2KWNmNKxKy/pfgMogZNx4BKUaNV+g8TSoJwIw2Rjaun3SPTubgR61+IUIZqVFE+pevsTsN3RSnyvFHJhLGbutPmJPAAmWO7RUVDQKfal4xqmH4NJ+w9gKWgixrRgWfTemtOr6k0dq4PrpHy6BKMYLrsTss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--axelrasmussen.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ShtDbs5l; arc=none smtp.client-ip=209.85.219.201 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=flex--axelrasmussen.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6b26783b4so2212737276.0 for ; Thu, 29 Feb 2024 15:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709250695; x=1709855495; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=wGdhmGNHVTXKtr8Coxlis0Li3Bk52TXuxtZPxJDknj4=; b=ShtDbs5lOFNRkk6Jtu8JScDIID2cRH09UM0rEHa6BxrEoF+X1yaRbj3RU6CeG2XhPK zVUjNdXaoVzLz+bFIWeoKiSGRylGGXlRo6mJFlF7WJj9SahP4UalsFo0L/xewY5DgREa osgTNe6OR3RRQ1TfTrYpVaq/8NkfmHVW81dOlE6j13uUtz/wCMExtr6qZBSip0UPZMxK vBmnRFke3t1oLrdUr7NYDKmitiMwCeHgfNKwG14qmca5IiNjPuTgIS2r7LQdyFo65Aon XhYFKgsUxJxKU4s5tCcQSfbzWi1ZTdPIQZ+MzTIgld13X5wetBVgn41crBn0GwIbqdz4 UKZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709250695; x=1709855495; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wGdhmGNHVTXKtr8Coxlis0Li3Bk52TXuxtZPxJDknj4=; b=YKGUj3pKuR+06LDokpwgV1u1coh2nCRkIEGaPV4sv0ZG2rS56LdEXVgIBRj1/O1XFA 1qfAHkFH/fTbdtAendILxknGYQ7AqDt2jO8OMFPL9JUteSyKn9d1b1PUNjgmIoVQS23q yi8Uh3hAl58CLnvkin9bnSIXZnpe8jvZruI0zOwF9Poe4V8BEhHpAxdrAY7UE0FglBku be5HZod2j/FkDrB7+W3v3amPgTWamk4T8iztNxzrmQsW3BsZW4ty6LQN5KtB73RAoFA7 XmGbYaV2sYMYxyAabj2sPsP6AUrHvXJB2XOCdhokQL1a69kFfCUTuZ2MLsOfFv0Jx/GW eeoA== X-Forwarded-Encrypted: i=1; AJvYcCUwCpZ7pNK+4ZlKdXyrpuApPCyCwttM3KlAFDtOQjh7eEqwc8DHh6KkrWQNOlTpcfZxLQoGGvjGOwKZKTdgJuSfCdEdrFDpfSROGfzB X-Gm-Message-State: AOJu0YxIoQVxIdoweXmjdCqSqGeKU1W2a6wDHCVhR1WnTOsG1gNIj41H xXD0fzevAyU1dtvIgO2UaBcO2LmSOhVLXHB8tPFoX+8G7SpUre1TtXbUhuG2x7Fv98NrlA8EvrP p1reLbtE+TIVqzhz79GIOY72K9RNvzQ== X-Received: from axel.svl.corp.google.com ([2620:15c:2a3:200:4ca4:66d0:de29:8d39]) (user=axelrasmussen job=sendgmr) by 2002:a05:6902:100a:b0:dbe:387d:a8ef with SMTP id w10-20020a056902100a00b00dbe387da8efmr177541ybt.1.1709250695530; Thu, 29 Feb 2024 15:51:35 -0800 (PST) Date: Thu, 29 Feb 2024 15:51:33 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog Message-ID: <20240229235134.2447718-1-axelrasmussen@google.com> Subject: MGLRU premature memcg OOM on slow writes From: Axel Rasmussen To: chris@chrisdown.name Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org, kernel-team@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, yuzhao@google.com Content-Type: text/plain; charset="UTF-8" Hi Chris, A couple of dumb questions. In your test, do you have any of the following configured / enabled? /proc/sys/vm/laptop_mode memory.low memory.min Besides that, it looks like the place non-MGLRU reclaim wakes up the flushers is in shrink_inactive_list() (which calls wakeup_flusher_threads()). Since MGLRU calls shrink_folio_list() directly (from evict_folios()), I agree it looks like it simply will not do this. Yosry pointed out [1], where MGLRU used to call this but stopped doing that. It makes sense to me at least that doing writeback every time we age is too aggressive, but doing it in evict_folios() makes some sense to me, basically to copy the behavior the non-MGLRU path (shrink_inactive_list()) has. I can send a patch which tries to implement this next week. In the meantime, Yu, please let me know if what I've said here makes no sense for some reason. :) [1]: https://lore.kernel.org/lkml/YzSiWq9UEER5LKup@google.com/