From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60D05C433F5 for ; Mon, 4 Apr 2022 08:44:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3BA66B0073; Mon, 4 Apr 2022 04:44:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEB7F6B0074; Mon, 4 Apr 2022 04:44:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB4F98D0001; Mon, 4 Apr 2022 04:44:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id ADF6D6B0073 for ; Mon, 4 Apr 2022 04:44:17 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5EE1D8178C22 for ; Mon, 4 Apr 2022 08:44:07 +0000 (UTC) X-FDA: 79318559334.18.3F9D22A Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf01.hostedemail.com (Postfix) with ESMTP id BE93B40021 for ; Mon, 4 Apr 2022 08:44:06 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 503DC1F380; Mon, 4 Apr 2022 08:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649061845; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X0N2SxV6GjMVBOdoERBEDYeu88UwXc3gO4jWk0FL4TE=; b=G27ShgYo1cdjBzpUTqcaG4sKAhfdAMb+RpuR95Gu71a11RnyRiUj34mel/G84IricAzl1X kyXI1UO5gR94PqCsnRxPa/AuFaQunXNCiDC9YAXhbTvnBHFk6MjUBQwrQPN3/Paj6Ur3bl eW8JqnJcBgsgVlF6rexeyRdjGKsJWyE= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A3109A3B94; Mon, 4 Apr 2022 08:44:04 +0000 (UTC) Date: Mon, 4 Apr 2022 10:44:04 +0200 From: Michal Hocko To: Roman Gushchin Cc: Yosry Ahmed , Johannes Weiner , Shakeel Butt , Andrew Morton , David Rientjes , Tejun Heo , Zefan Li , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Jonathan Corbet , Yu Zhao , Dave Hansen , Wei Xu , Greg Thelen Subject: Re: [PATCH resend] memcg: introduce per-memcg reclaim interface Message-ID: References: <20220331084151.2600229-1-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: dt7bqdd4tef5dwqk4e8dsdkgnqb1dcfi Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=G27ShgYo; spf=pass (imf01.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BE93B40021 X-HE-Tag: 1649061846-252552 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri 01-04-22 09:58:59, Roman Gushchin wrote: > On Fri, Apr 01, 2022 at 03:49:19PM +0200, Michal Hocko wrote: > > On Thu 31-03-22 10:25:23, Roman Gushchin wrote: > > > On Thu, Mar 31, 2022 at 08:41:51AM +0000, Yosry Ahmed wrote: > > [...] > > > > - A similar per-node interface can also be added to support proactive > > > > reclaim and reclaim-based demotion in systems without memcg. > > > > > > Maybe an option to specify a timeout? That might simplify the userspace part. > > > > What do you mean by timeout here? Isn't > > timeout $N echo $RECLAIM > .... > > > > enough? > > It's nice and simple when it's a bash script, but when it's a complex > application trying to do the same, it quickly becomes less simple and > likely will require a dedicated thread to avoid blocking the main app > for too long and a mechanism to unblock it by timer/when the need arises. > > In my experience using correctly such semi-blocking interfaces (semi- because > it's not clearly defined how much time the syscall can take and whether it > makes sense to wait longer) is tricky. We have the same approach to setting other limits which need to perform the reclaim. Have we ever hit that as a limitation that would make userspace unnecessarily too complex? -- Michal Hocko SUSE Labs