Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2679579rdb; Mon, 5 Feb 2024 14:17:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZ2UKXRNJ4oknEqa8zl68oi8aBNfBFk/jghUpdlGCRhvAhVzSz6YMc/LixjCZBUS9dfkZH X-Received: by 2002:a17:902:d502:b0:1d9:b3d7:fc44 with SMTP id b2-20020a170902d50200b001d9b3d7fc44mr1076141plg.22.1707171425191; Mon, 05 Feb 2024 14:17:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707171425; cv=pass; d=google.com; s=arc-20160816; b=JbcOL+hIYuzRNkzuvZMlkaMVJudUJO9xBaj6Y9lviYQTOG5CjAszOEqqjV4zGJyUyG fFO39jBVycoIaUq8JTfQsJexXNVyr4VvYgWIsiYTc8W7nzftL2E3qcKhVbkYRd+WwhcI LtmEN0bsAKmpeeUYiQlNmJDohoNs/9sRVyDMW99hzTePvDWwb0kDcUNar0RIn1DjlKsy k0sCX27qTPNnBnY3Zmeas5TZ31yW8f9iTTKB02qWUfdbyt3Dw0/J5QpRUUdEUsUzxzOV 51TJ9o16sJCnbd9If9zMM5aZFFS3OICQs0xNrXGCNyN28nPLU9t51ijxfADI/vrTSxom pyMA== 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=UqjQ8uzPWkoXvaP3jSmRX0mX+6vg7iSnhNElmOf67RA=; fh=9jwdQ4EzYs2zlb8F6se3E9Citv3O2vgYQ9D+LVgr43w=; b=iKKuFgziV0iGyKSPdRWqJ5jqUba1RiKuYxTOx6BR0CXn6jH8SjWCD3wKamLaK87ZVb TaLQUWVo1yeyp/l7rzSrcxUaLSR2u7lxr3clg/UJNJAV3px03uke0UCT4FV8yt4a2zfF xxsGs4mQpbTKCRkQM5MefiDCxO4EKXR3/f9QV1vKXddL0T35KpcHlBvbATUf2VpU0veW pwwDi91pQDNh5kVU/mzV9V+2cMUh4wzBkqdIyj6nh5vCSbJdYBCiNF9u0+P3SoKvBlEW kN194LkwjVuwI3WUReiamYGOInlbxPxxuS42qj3aHUK1nxrVtlRxpYXf9K2JaX1YsU4Y 4www==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2QTPAlp; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2QTPAlp; 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-53964-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53964-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCUy/r2RUfssf5ZHCH0T32cRrOBtiTMqJwydhP67Fx+6rU4fjs7/R9VDfzjdkguqwfD6Eh8k1AXF8/Of84ly8Veb8SvOY9rQ8c6Etr/YHw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s20-20020a17090330d400b001d7852b985fsi493365plc.121.2024.02.05.14.17.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 14:17:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53964-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2QTPAlp; dkim=pass header.i=@suse.com header.s=susede1 header.b=k2QTPAlp; 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-53964-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53964-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 5B13128EBDB for ; Mon, 5 Feb 2024 22:05:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0F911AB81B; Mon, 5 Feb 2024 21:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="k2QTPAlp"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="k2QTPAlp" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 1E7451AB806; Mon, 5 Feb 2024 21:16:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707167799; cv=none; b=l55TFodvNvHpU+AIfFiBJdfyuY3NRr4x1sNPYz9cZdhHex0csTlMJQLqSs9eZIqE9tcRuY/+ahDGpnXKWNyQxxp0QGBZeyh+2J4EKrM0xHA/bl8jQFZCFT5ypfc6oUPXtl/vr0NkR689iDh6hFWPwr4hWosLUrAHfhaDiPm/tvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707167799; c=relaxed/simple; bh=w+LuAn4eMxEN1OrwnjXfkUZofNi+HXJroO9FLryNtL4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D4v8WBqwuh/JcQzY9v/cCXx/sR9ShlmsxKgb9891QHFrk//HQMjc/kAkCucbYUow/5SIJt4SsEVzGneuzJp+yahnbrYEQ74KJFIIAJ3d0xh36IKnLdYs6LcmscWFxAoT1ELi9kMEk47vG1IOKYs2rCbGbJdPjWahcKmq5ao1BIs= 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=k2QTPAlp; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=k2QTPAlp; arc=none smtp.client-ip=195.135.223.130 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-out1.suse.de (Postfix) with ESMTPS id 52B1021FB3; Mon, 5 Feb 2024 21:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1707167795; 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=UqjQ8uzPWkoXvaP3jSmRX0mX+6vg7iSnhNElmOf67RA=; b=k2QTPAlpUZx9xWdcIwXtXXDq0RS18tpEXYVMAwgeXgBnBYJefWMYQ93JLDFkCalSq3ycUy VZAEpeop+Dxd1H2y4UYD/k2bR0lxrH87nVnAGgfJdz4CSRW/671XL7U+K2ActeCA0IKwI6 nBokQeUPwfSSneyy/npR/ngpYbv+j+0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1707167795; 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=UqjQ8uzPWkoXvaP3jSmRX0mX+6vg7iSnhNElmOf67RA=; b=k2QTPAlpUZx9xWdcIwXtXXDq0RS18tpEXYVMAwgeXgBnBYJefWMYQ93JLDFkCalSq3ycUy VZAEpeop+Dxd1H2y4UYD/k2bR0lxrH87nVnAGgfJdz4CSRW/671XL7U+K2ActeCA0IKwI6 nBokQeUPwfSSneyy/npR/ngpYbv+j+0= 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 2F00A132DD; Mon, 5 Feb 2024 21:16:35 +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 tIwCCTNQwWWHUwAAD6G6ig (envelope-from ); Mon, 05 Feb 2024 21:16:35 +0000 Date: Mon, 5 Feb 2024 22:16:34 +0100 From: Michal Hocko To: "T.J. Mercier" Cc: Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Efly Young , android-mm@google.com, yuzhao@google.com, mkoutny@suse.com, Yosry Ahmed , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm: memcg: Use larger batches for proactive reclaim Message-ID: References: <20240202233855.1236422-1-tjmercier@google.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-out1.suse.de; none X-Spamd-Result: default: False [0.28 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.12)[66.62%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_TWELVE(0.00)[14]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.28 On Mon 05-02-24 12:47:47, T.J. Mercier wrote: > On Mon, Feb 5, 2024 at 12:36 PM Michal Hocko wrote: [...] > > This of something like > > timeout $TIMEOUT echo $TARGET > $MEMCG_PATH/memory.reclaim > > where timeout acts as a stop gap if the reclaim cannot finish in > > TIMEOUT. > > Yeah I get the desired behavior, but using sc->nr_reclaimed to achieve > it is what's bothering me. I am not really happy about this subtlety. If we have a better way then let's do it. Better in its own patch, though. > It's already wired up that way though, so if you want to make this > change now then I can try to test for the difference using really > large reclaim targets. Yes, please. If you want it a separate patch then no objection from me of course. If you do no like the nr_to_reclaim bailout then maybe we can go with a simple break out flag in scan_control. Thanks! -- Michal Hocko SUSE Labs