Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp896924rba; Thu, 21 Mar 2024 18:33:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjlhAmccE97pH0uMigxFMF3iU68iQvQG63FurwEAjCFyZZNc2jaC7Vlr/vDoGyP6JCLkL1A5h7JJdnKoU9uO5gw+ApHqLQlWVe9pK8KA== X-Google-Smtp-Source: AGHT+IHw8t6XyjhKYquIxfeY5lfdm2oG7ALyQhM6jlZ82pKk4ueMGLpBIOzAeuZYOgTn+nRgWsrT X-Received: by 2002:a05:622a:2a18:b0:431:2fe7:8fb8 with SMTP id hc24-20020a05622a2a1800b004312fe78fb8mr869726qtb.1.1711071196757; Thu, 21 Mar 2024 18:33:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711071196; cv=pass; d=google.com; s=arc-20160816; b=WOb5zVjuZKIKAVNfjnVHm+k/ZZofHmnxiP41AhYiMYMb+wsu6F0S83OLaaMmiayX5X xCzHggvg4G5y3arcqaOFFirpKezkutTSi3ms4UibMqsFJ+WkJVcdRDRavQA5Tosxrnxm Y7gzYmTmTT0Yq3CeGVoiweOilX1ebxa2TQyxuzcKteEdhlMCvnepyISoGJw9Yrq14BDg Dj/88/RLvRCLgTxXVD6OCqL6wjxWwvUHpd36dqltgauLSbeOY/3MKdO5D9ygiu3MAVQq su05WlKltD/X2XEpiEUSkGr0TZzBBtTlXCe3jybYQx2v0VVQi6f1HjGXHWFgQtZEKLrR X0RA== 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=elX0v/wzn8FOI5S/DSgb8r/0YEFXzUdTLBxZj76WCmE=; fh=tLuEdyZ7m09DbYC11DKwyWAsTraxLYyLuUzyY4UiQeM=; b=lBRJsu9DRYy0eDLfkqM1wED8BRdOkjyB+aPyhSXrp3qR++dh7IVxiMvjrO3cIwh0wc Wpv39/e76lS1+OWJFoJrELUXhaIdoNcKld2fJPY6xiJdji45df4fFb8qWiJCLQ8or/A6 7ikuArjEhzlD/01fZjD9TnlFLlwtWmCs4SgSMIge5DwmVKPYaaXgVOD/R3cnWk4tfjK+ wleevYV4Xq/cjcvMyxm07et+VDJiEfkx1BACZayRFHoul2/vg3cT5UIL5NMEWlrdxV3P q99VX0KqopHWXOAHQveqfP/hlF+wwCTUv58Y+V9hpDZQFmmLFoM/2h7DhsFwQxYEtAy5 01XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZAESQsjB; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-110857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d15-20020a05622a15cf00b00430d431e9b0si1016414qty.232.2024.03.21.18.33.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 18:33:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZAESQsjB; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-110857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 80FE71C229C8 for ; Fri, 22 Mar 2024 01:33:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35AEE4688; Fri, 22 Mar 2024 01:28:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZAESQsjB" Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) (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 D76412570 for ; Fri, 22 Mar 2024 01:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711070938; cv=none; b=ZqGQlGoMwp0EDm0eqOZB0+a7s4LjYOcKFwulktM4CjZd5sNcJeZXKrMGAqJllrnHg53CN1uiZmZJuPysJePZJrvnD5Mlh/ZdV8EE7nt3t/zZ2vFe/jxafEGAZKmfyCVd4crtw6hW1RidwZyqrfrn3x8ILyV1gTYDpzJNXxQVaMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711070938; c=relaxed/simple; bh=wUWtK/vMJLZwX1DvkPLzIaDS7xtrHfNcefyZ/OZD9mg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=C6xI2+u8emnasU1gPdGdHtfjdbRFCpcNUv61l4eeL+PkRd65A/8w9Lho0Kw0PL1GuGgKOKLPd1WNv4QoGbCE86UBCHDzD6pf/HyRsuj6iL7jOoa7vz5NEKmyBqUktosvGIf2pEozZxWCfTI/MlxKqa0uSsDqrdLmnwungYk5mTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZAESQsjB; arc=none smtp.client-ip=209.85.221.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-4d44d160830so1461576e0c.0 for ; Thu, 21 Mar 2024 18:28:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711070936; x=1711675736; 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=elX0v/wzn8FOI5S/DSgb8r/0YEFXzUdTLBxZj76WCmE=; b=ZAESQsjBn4dTXFqyfBbHV4w+qQBBLJ/nEfHpi6cTNxV3Y/ll/lyGWmSYzbF8kVxwK7 PN7FVagNlsaRR/+Uxcr2B0swkiW8nUWPcTVAK6O0InCNngQJ8/g7gkcgOhAGT7D0gtY+ GRAxpzxyhEUI/YMpjLLHxRxRjS2o9cJT8X7wz5qBham54wH9wz4Wf5PEPf/mo7hyvyND nvdgA+Zg3DTSZJlacrFjWq+YqCCkkSjPLQeYI4KD59oLJPz78B5fyQfjYD4y12dpvBlB Qr/JA1wAKUfheLf3ubqUcdUN8rvyeHgJIqn2ECvLwNzr2ir4kju/+er5kTmucC4eg3kn N8Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711070936; x=1711675736; 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=elX0v/wzn8FOI5S/DSgb8r/0YEFXzUdTLBxZj76WCmE=; b=VG6eQEGBQQgkBmThBtN7IiCvrVF8iKKyMFGaJoYjZoA22zsfX8MExgLjOSWVv9/CD0 WLuisDZOd4Ct4CabZqajbEG2HN5H8xtejrgaTMxdUsQtlOrCwCaclDsCdEMl6lY68rJe YpQWc05HhU4w/uNFGmQZ5Xxn6mG9Zou0AzgOhLyq4f7HiNcgelS1BQyqt71vSCgd2FQY ufrBJS56Hy0gBYFrYIuk0ONFKpnti0DrypkyAK8o6kiRIibBZCc5tdHCYxxO9P4kbIxh F2dYpJKmZB6h2vlDHZMrsgLB+oHovpPfKCKvnLHLMTfJE8P00A1Q8KQC831RVsprGTFc j6UQ== X-Forwarded-Encrypted: i=1; AJvYcCUcWBNPLac7YfDRAXvOclhHaKupIkQqn2qf/+CQIUzrNGrmffhVOUkJJf+Gs1n12XLdIKqQA/Gi5abnzwqFhyoN9X3XXROasgcFfiSN X-Gm-Message-State: AOJu0YxYIv/PNo9bysOKzDXE/GzbTA6ju74eyRpbKCypZ0eZw0Nv8QEO EPxLTrx7iD9s2eB8joP2S1PylvLhyvy5sfmom3Qlh1MhChCk6JVKWt5bHJkyfXgTo18RijroNhQ i4o3oAJYW/+owHZbzElpqFqfCpSe0wHVo6Fbeww== X-Received: by 2002:a05:6122:2014:b0:4d4:11e9:c33f with SMTP id l20-20020a056122201400b004d411e9c33fmr596399vkd.5.1711070935188; Thu, 21 Mar 2024 18:28:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240314141516.31747-1-liuhailong@oppo.com> <20240315081803.2223-1-liuhailong@oppo.com> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Fri, 22 Mar 2024 14:28:44 +1300 Message-ID: Subject: Re: [PATCH v2] Revert "mm: skip CMA pages when they are not available" To: Michal Hocko Cc: liuhailong@oppo.com, akpm@linux-foundation.org, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, surenb@google.com, zhaoyang.huang@unisoc.com, quic_charante@quicinc.com, yuzhao@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2024 at 2:40=E2=80=AFAM Michal Hocko wrot= e: > > On Tue 19-03-24 19:09:18, Barry Song wrote: > > On Tue, Mar 19, 2024 at 4:56=E2=80=AFPM Michal Hocko = wrote: > > > > > > On Fri 15-03-24 16:18:03, liuhailong@oppo.com wrote: > > > > From: "Hailong.Liu" > > > > > > > > This reverts > > > > commit b7108d66318a ("Multi-gen LRU: skip CMA pages when they are n= ot eligible") > > > > commit 5da226dbfce3 ("mm: skip CMA pages when they are not availabl= e") > > > > > > > > skip_cma may cause system not responding. if cma pages is large in = lru_list > > > > and system is in lowmemory, many tasks would direct reclaim and was= te > > > > cpu time to isolate_lru_pages and return. > > > > > > > > Test this patch on android-5.15 8G device > > > > reproducer: > > > > - cma_declare_contiguous 3G pages > > > > - set /proc/sys/vm/swappiness 0 to enable direct_reclaim reclaim fi= le > > > > only. > > > > - run a memleak process in userspace > > > > > > Does this represent a sane configuration? CMA memory is unusable for > > > kernel allocations and memleak process is also hard to reclaim due to > > > swap suppression. Isn't such a system doomed to struggle to reclaim a= ny > > > memory? Btw. how does the same setup behave with the regular LRU > > > implementation? My guess would be that it would struggle as well. > > > > I assume the regular LRU implementation you are talking about is the LR= U > > without skip_cma()? > > No, I mean standard LRU reclaim implementation rather than MGLRU. I guess Hailong was running the standard LRU with active/inactive lists as his v1 even didn't touch MGLRU, https://lore.kernel.org/linux-mm/20240314141516.31747-1-liuhailong@oppo.com= / Hailong, please correct me if this is not the case. > > -- > Michal Hocko > SUSE Labs