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 5DBB8C46CD3 for ; Sun, 24 Dec 2023 21:13:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 778056B0071; Sun, 24 Dec 2023 16:13:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 728936B0072; Sun, 24 Dec 2023 16:13:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F01B6B0074; Sun, 24 Dec 2023 16:13:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4C5206B0071 for ; Sun, 24 Dec 2023 16:13:41 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1BE3A140351 for ; Sun, 24 Dec 2023 21:13:41 +0000 (UTC) X-FDA: 81602963442.24.54778C2 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf21.hostedemail.com (Postfix) with ESMTP id 561391C0009 for ; Sun, 24 Dec 2023 21:13:39 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fUHNtPqv; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of rientjes@google.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=rientjes@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703452419; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Ld/PwS9QxP35fVzGwf1si/oFabvWirIW5YkS+UkDPZo=; b=CPlHz196HOCWus2zOw+EF+Zvww+yJW4eavDQ5U1c06zzGWoN9xgUBIElahe0EjzJ5T9Zgq 3TU0JrAJrXgn/NVrFNg975YeFo2vRcYckEKn7ZPG4likfBQLVFw0RpLrSpMp7RECTA9htU x3ZpWXHVPEOqcOou94CzQudLIbV+sQM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fUHNtPqv; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of rientjes@google.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=rientjes@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703452419; a=rsa-sha256; cv=none; b=gbSMuvB+DPTjwQoITVEKZ1wVX0jEnqv6mgHSWs97hk5eueGZMDJsVuQSvH4JWfAJX4+u3+ hptsPPt9hQyX0wTUXT5NvnJWxIdzs+EQwtTGYr567AM9L6KVOpf25D+9Qm2cNUoH82zj25 4YMTAymwtCsX3K5kQCIDNXbmE3oC0Qw= Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d3ea8d0f9dso258835ad.1 for ; Sun, 24 Dec 2023 13:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703452418; x=1704057218; darn=kvack.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=Ld/PwS9QxP35fVzGwf1si/oFabvWirIW5YkS+UkDPZo=; b=fUHNtPqvxz4mhZyIPfKzPJdNGfiYJh+r+ZDgYHPNA+Rr2JEKrFgMzNVfZhptXsonHn jqae3HUK6Ht6BSCiDBy4sB1aeT44y1PrYvsttLV9K3X5ZFvHGMC461CpTmPooLZyDNsC Srt8rEroG39F2FwnFGs4CV2KoDkOcE6IxQ9L/CHCqHzjFcnA4ECuXpv1nRaTcfz+Xrfu OGxObs6DTADOZPehdUCZ2zOE3t7DP6+r+SQJUA0EmqkKQj5c5qPdGEjaK/LfmWGcxUH2 8V+qREv4mWXnPwa8JWquAnLHZdELl0uvaOxYNxA5UHO1KuBSGOu2QP9EuocDQeouKQD4 /hfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703452418; x=1704057218; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ld/PwS9QxP35fVzGwf1si/oFabvWirIW5YkS+UkDPZo=; b=qwmGHKEI/A0bIwD+/tmZ6efLbHO30rrsd+0WBge6rw2j0KfwgYTM5VsY8g7vdgRc0C RmYT63F/UPVqJP+BvwYtOo7yRQL/QwAJ/DNbziDh2UI8P8YJyYiWFsgx3u8h2ajlk9Kw S+jixv7yEGJAYvhPvTQgbn5zTHWz5kM+pGzGxGxZ0QHwxaQxfes1JxW5EQgU6tdfqTbL 0T1zfRozkBqQ8kh7LwGcXwg/8j0e7g/8+VHU6oav5kAx/02jV7iXWa22nBwb0NORiDsu Y4N8LyBRoRhxyOZvZEt9LhiucY8EypKSBnXnJvNmM0Ox6UlxUQmtiw5/+jlrLOV0i19N ViNg== X-Gm-Message-State: AOJu0YyPcrKfgAkQfu2bf4/LBHbmqN0EP4L61joc3R3kjRGpLxW3lMTv /0F3D+Yfl/C9EZeXjcgAEIvwfFmTnuRg X-Google-Smtp-Source: AGHT+IHTFbA+Z+7qQ9NP2ATiactA8TghGwPXzMrtijnW9nT3cEmUm7J5fRWtR3iCcEvbT4ZBxFSz2g== X-Received: by 2002:a17:902:ce85:b0:1d0:a45c:202 with SMTP id f5-20020a170902ce8500b001d0a45c0202mr286301plg.24.1703452417758; Sun, 24 Dec 2023 13:13:37 -0800 (PST) Received: from [2620:0:1008:15:c723:e11e:854b:ac88] ([2620:0:1008:15:c723:e11e:854b:ac88]) by smtp.gmail.com with ESMTPSA id 5-20020a170902c24500b001d078e31cd1sm6859208plg.259.2023.12.24.13.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 13:13:36 -0800 (PST) Date: Sun, 24 Dec 2023 13:13:35 -0800 (PST) From: David Rientjes To: Chris Li cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Wei Xu , Yu Zhao , Greg Thelen , Chun-Tse Shao , Suren Baghdasaryan , Yosry Ahmed , Brain Geffon , Minchan Kim , Michal Hocko , Mel Gorman , Huang Ying , Nhat Pham , Johannes Weiner , Kairui Song , Zhongkun He , Kemeng Shi , Barry Song , Hugh Dickins Subject: Re: [PATCH] mm: swap: async free swap slot cache entries In-Reply-To: Message-ID: References: <20231221-async-free-v1-1-94b277992cb0@kernel.org> <20231222115208.ab4d2aeacdafa4158b14e532@linux-foundation.org> <0a052cb1-a5c5-4bee-5bd5-fd5569765012@google.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2003067076-2146640772-1703452416=:2161414" X-Rspamd-Queue-Id: 561391C0009 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: azasgdn64opoyk7gcxohbsqkw4ihodq5 X-HE-Tag: 1703452419-821083 X-HE-Meta: U2FsdGVkX192mXipdg95RWRkZKRyoS0Aqw++bT9H6kqr/8nK8cit5pFmQVTdGTkIbsQ+hWXnuLpc3Gt0uBBzT4Tc7B0wISuv/dnxE0epDP4yUSg7FN0rSZtwiVCZaECUQGY1uo+QMLkv8m9k/6aFZb8x+I7z42n6JqDfoWQlq0zXe5Uuf2IhJ9VC0cUkhNzWawmz0sYOzNqe6ZWRotV5jeDkFuQLxZscMjAs6zOYjPG3wgoyt090FtZAiJgf/V4nIrQ9hLlmzUwp+xRC6cxLmhcSMA68KkPbTqN4UN18NdC4mucnc7dy24xXFRC7oeK2JJCmDwCqhdarCuEczMPEKij+YSUBSPTvQ2U0P0cx42U1Rx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qf658MFG3vcbmv3JOCzctMf8gAGQDgHiQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.003637, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2003067076-2146640772-1703452416=:2161414 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 24 Dec 2023, Chris Li wrote: > On Sat, Dec 23, 2023 at 7:01 PM David Rientjes wrote: > > > > On Sat, 23 Dec 2023, Chris Li wrote: > > > > > > How do you quantify the impact of the delayed swap_entry_free()? > > > > > > > > Since the free and memcg uncharge are now delayed, is there not the > > > > possibility that we stay under memory pressure for longer? (Assuming at > > > > least some users are swapping because of memory pressure.) > > > > > > > > I would assume that since the free and uncharge itself is delayed that in > > > > the pathological case we'd actually be swapping *more* until the async > > > > worker can run. > > > > > > Thanks for raising this interesting question. > > > > > > First of all, the swap_entry_free() does not impact "memory.current". > > > It reduces "memory.swap.current". Technically it is the swap pressure > > > not memory pressure that suffers the extra delay. > > > > > > Secondly, we are talking about delaying up to 64 swap entries for a > > > few microseconds. > > > > What guarantees that the async freeing happens within a few microseconds? > > Linux kernel typically doesn't provide RT scheduling guarantees. You > can change microseconds to milliseconds, my following reasoning still > holds. > What guarantees that the async freeing happens even within 10s? Your responses are implying that there is some deadline by which this freeing absolutely must happen (us or ms), but I don't know of any strong guarantees. If there are no absolute guarantees about when the freeing may now occur, I'm asking how the impact of the delayed swap_entry_free() can be quantified. The benefit to the current implementation is that there *are* strong guarantees about when the freeing will occur and cannot grow exponentially before the async worker can do the freeing. --2003067076-2146640772-1703452416=:2161414--