Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp875837lqt; Tue, 19 Mar 2024 06:40:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPbkfY+3doRL6P0/MmM42Rs6q4LyA8efJ9JxC7EL2mZFcBW/PGSVm6F3sWmwwwJ5e3ypynQs0BxB/5zNb8pzWTQE2iycc2zs05t0jQGA== X-Google-Smtp-Source: AGHT+IE//DRhNEXIJsSJhUAbn8Wdw0h60j5SwojLwxso3qAivGW1BnfnWzGePjdVNxrOKKsUq4Lp X-Received: by 2002:a17:902:c285:b0:1da:1c72:2ca7 with SMTP id i5-20020a170902c28500b001da1c722ca7mr15294707pld.29.1710855654811; Tue, 19 Mar 2024 06:40:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710855654; cv=pass; d=google.com; s=arc-20160816; b=wJ5cTNj76SlJY8va/1tTRSpRAEhlLSmXF8pJ8p1mGXExjWfaoZX0EOzWpwT3x3NP9I B820XcWRP4Umvoo18A1+z/d5i6DGt8I6vuLg4MnjFQF+c9W62uh2q45VnKqkSD0z+W+V WGOgtaFql2qzdVzvqprWNV6AFpRJiPzV7fJlLUDXK0zXDDXZVPHWn4ij9wHy0fxf2Heu tRJ4YiYtfsQnRaZM2drhv1gD1omA+RWEUnPfkF8e5qRZLqMbSlovxywvN89faHKWh/JM YURyER7WSN4LC035Ia5IoDWGx2kKZSyk0dmG4cQNyBV39wN9g1Dd+LwAMXpuWAFrZqHd 4xxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=gPnsq29Wc/buvWIEmuCObK4jFQyJYrkPVaoqmvReZ3g=; fh=AWsEVrjRMzLEqIiPyOJfUmpfEyuN6rZ52cYtCicJatk=; b=b7yKjqdk/E8dY4PigR98PkzIVxfgXyoX5YBtecNgo+quqy1COB35CnBSBwWQrKdIQx 1Uk9qMA22FABdo33zc8PF+lzHwUV3dUJCetbyWDY7DDQu9dEfsgweOa4S5GkYZmUe9qP RrNynW5LSztCAnNBT3e7pGgIRaOFZ42RBaek8fyflvmgubTRExSp30IfSrLjSRA07ahs LpP0QSk4wKUarhJeSUfddTaDFS2dOZ0q9WxucPYe3bvC+15Ft7N54D/HHkJvA96o+7qi H5BxQhMkpD6tOqbtwZ5bm96dTjKXQMbeIvKtzo43/0XOvoWS2wmAL6c9D26u5ZuuWlTJ GtzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=HNys9iGe; dkim=pass header.i=@suse.com header.s=susede1 header.b=HNys9iGe; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-107601-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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-20020a170902684500b001dddbb58d55si10962226pln.390.2024.03.19.06.40.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 06:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107601-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=@suse.com header.s=susede1 header.b=HNys9iGe; dkim=pass header.i=@suse.com header.s=susede1 header.b=HNys9iGe; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-107601-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 64D6828550A for ; Tue, 19 Mar 2024 13:40:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F48E8060B; Tue, 19 Mar 2024 13:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="HNys9iGe"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="HNys9iGe" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 E147A2B9A3 for ; Tue, 19 Mar 2024 13:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710855646; cv=none; b=mQMQYE+CEaipGt0i3Sm3zz+MAIWc9EanoqSFkAAMppNHXL1vYTC3eMEpL0XI4/OwGMcxa6I0AyjfPccFIqlua3dxXuCNEs+wa99a87+qeUlxJTu8OrMk+kn4e5eiaE4ZMPiyBZLtBHgVUw7OZIdiuStglDPG7lI/eiHwbfgdzBE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710855646; c=relaxed/simple; bh=63oP/O63tle25p4dXnRwpLxRWoEsPPqahgfFN+0CMCE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=or4dB8IFwCrQ+FXB+Uivk9HWLP4VKlFldwPoTkHg6QOvuataDNd4hangspoq+03jkThrrgEkBdUYL5A1PCjWMV/nIHNC8SG/Ms7jFhr7F9LgdkNmfajhgkWl8woYKddecBfQwCuWLmKmhQV1LlEtaYRk296ihyg0kRwKZe/Chhg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=HNys9iGe; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=HNys9iGe; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1F5495D714; Tue, 19 Mar 2024 13:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710855643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gPnsq29Wc/buvWIEmuCObK4jFQyJYrkPVaoqmvReZ3g=; b=HNys9iGe2SR/wFIjkvSlF8NHw/ARy1KUUGVVXmmib3rYzIqtQMQgy7Tc/LDPFq57vSrfqP 4AePwczBpK/GQevULP+7L6FytLrElZJcjZUf6qUhw9mMAKz3hd4FPqV6z+1qIRh4/AONiG IeKogcEvtKvKAtvAoXV+EkA8cw09sEc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710855643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gPnsq29Wc/buvWIEmuCObK4jFQyJYrkPVaoqmvReZ3g=; b=HNys9iGe2SR/wFIjkvSlF8NHw/ARy1KUUGVVXmmib3rYzIqtQMQgy7Tc/LDPFq57vSrfqP 4AePwczBpK/GQevULP+7L6FytLrElZJcjZUf6qUhw9mMAKz3hd4FPqV6z+1qIRh4/AONiG IeKogcEvtKvKAtvAoXV+EkA8cw09sEc= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C4F0C136A5; Tue, 19 Mar 2024 13:40:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id AIUdLdqV+WWraQAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 13:40:42 +0000 Date: Tue, 19 Mar 2024 14:40:34 +0100 From: Michal Hocko To: Barry Song <21cnbao@gmail.com> 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 Subject: Re: [PATCH v2] Revert "mm: skip CMA pages when they are not available" Message-ID: References: <20240314141516.31747-1-liuhailong@oppo.com> <20240315081803.2223-1-liuhailong@oppo.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.82 X-Spamd-Result: default: False [-0.82 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[13]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FREEMAIL_TO(0.00)[gmail.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.02)[54.42%] X-Spam-Flag: NO On Tue 19-03-24 19:09:18, Barry Song wrote: > On Tue, Mar 19, 2024 at 4:56 PM 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 not eligible") > > > commit 5da226dbfce3 ("mm: skip CMA pages when they are not available") > > > > > > 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 waste > > > 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 file > > > 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 any > > 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 LRU > without skip_cma()? No, I mean standard LRU reclaim implementation rather than MGLRU. -- Michal Hocko SUSE Labs