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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7018DC48BDF for ; Fri, 18 Jun 2021 17:29:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ED20661159 for ; Fri, 18 Jun 2021 17:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED20661159 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 851F76B006E; Fri, 18 Jun 2021 13:29:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 801C66B0071; Fri, 18 Jun 2021 13:29:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6542C6B0072; Fri, 18 Jun 2021 13:29:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 33E736B006E for ; Fri, 18 Jun 2021 13:29:49 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C5FFDAC18 for ; Fri, 18 Jun 2021 17:29:48 +0000 (UTC) X-FDA: 78267532056.09.A7577B3 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by imf27.hostedemail.com (Postfix) with ESMTP id 7EBE08019366 for ; Fri, 18 Jun 2021 17:29:47 +0000 (UTC) Received: by mail-qk1-f182.google.com with SMTP id q64so6417195qke.7 for ; Fri, 18 Jun 2021 10:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MDqR7W4yXQCvkXsnmPwhAYo/pxcSJzJ3a33+/Daa0uQ=; b=tlKYNHoJKQ717Wgx+oKVyuIEe8YtJI+Nn01hhT4DgoCaC88ilBmdTeB73xxHXK97Rj uQS/lp9yilJvs3jKBXXmHGAeGHwyWZPNOJDwfbi4TlHp2CCCO/zoA4OvxnQ8xNJCoszI HqvLGpy/mB5vJQ+XdM6SJHEyKKNlOziKmL3wU+EsZrJhVXrtR12jp1PK6MAJy7yoxmRk Km/K8DfdbAnEYTkYH4fINxE/E9qLFD/+sWya7Axtvh+N4iHl1HImIp4ptD71ytIpPb18 JWgxBEWy0e3PrlBLLEwiyyBKPOAjjy73TqEhmmGG+VJqufb8/2qBC2T5IZtBR1ukh3jh /ALw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MDqR7W4yXQCvkXsnmPwhAYo/pxcSJzJ3a33+/Daa0uQ=; b=aoUchup9YsXg2JZ8kwVsiO9pdGJY1JbRJHO3p/qQMVRjPsQUiMRQllEI778SgGp+c5 sTrJy37Chj1xX27xxNGDuv6OZLP8AMOTj6qi7Rxw7X5TlpPGpWrE8zb7eyO3A1n5zw8z TQ3VaMTSLs4w6NIRUTzgM0oCLNeDbeDca/f5S49lmDVvdZSJNZL50MqIxOVp3qdDfl7p KkoDW0Prk04pHoFgERTjjJUCe2oTcIqyeXw48WfXxqH6+4FdKXR/oo2/zHniHlOByDMe XKpP2sgbpZdcX7uNvKIqoYhOVq9UBajBt/tcBHoOFCGxSWgGBlo+wOmNQ1bMHXT7BYsg ovyw== X-Gm-Message-State: AOAM53217dpmBQY342k84Wq2p8AEDW8DTfmrJW+Gf4m4dQD0kwb2G2f8 kK8rMWmwQZQU+fZRt2VPPoCxKQ== X-Google-Smtp-Source: ABdhPJwj0x4VwWE+SOwFVKpLufRmLSe5wzxJRgydxXgTHZpdvGvFYrh2LKPjmY5S6n12H79ISqah8Q== X-Received: by 2002:a05:620a:5fb:: with SMTP id z27mr10652616qkg.262.1624037387382; Fri, 18 Jun 2021 10:29:47 -0700 (PDT) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id g15sm3139288qtq.70.2021.06.18.10.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 10:29:46 -0700 (PDT) Date: Fri, 18 Jun 2021 13:29:44 -0400 From: Johannes Weiner To: Vlastimil Babka Cc: Miklos Szeredi , Matthew Wilcox , linux-mm , linux-fsdevel@vger.kernel.org, Thomas Lindroth Subject: Re: Possible bogus "fuse: trying to steal weird page" warning related to PG_workingset. Message-ID: References: <016b2fe2-0d52-95c9-c519-40b14480587a@gmail.com> <029095d9-399a-e323-15f3-b665e9852eb3@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <029095d9-399a-e323-15f3-b665e9852eb3@suse.cz> Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=tlKYNHoJ; spf=pass (imf27.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.182 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Stat-Signature: pte8jg9t8ks5fx8ho4yybpkk6raorm3g X-Rspamd-Queue-Id: 7EBE08019366 X-Rspamd-Server: rspam06 X-HE-Tag: 1624037387-226719 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 16, 2021 at 06:48:34PM +0200, Vlastimil Babka wrote: > On 6/16/21 3:47 PM, Miklos Szeredi wrote: > > On Wed, 16 Jun 2021 at 14:59, Matthew Wilcox wrote: > >> > >> > AFAICT fuse is trying to steal a pagecache page from a pipe buffer > >> > created by splice(2). The page looks okay, but I have no idea what > >> > PG_workingset means in this context. > >> > > >> > Matthew, can you please help? > >> > >> PG_workingset was introduced by Johannes: > >> > >> mm: workingset: tell cache transitions from workingset thrashing > >> > >> Refaults happen during transitions between workingsets as well as in-place > >> thrashing. Knowing the difference between the two has a range of > >> applications, including measuring the impact of memory shortage on the > >> system performance, as well as the ability to smarter balance pressure > >> between the filesystem cache and the swap-backed workingset. > >> > >> During workingset transitions, inactive cache refaults and pushes out > >> established active cache. When that active cache isn't stale, however, > >> and also ends up refaulting, that's bonafide thrashing. > >> > >> Introduce a new page flag that tells on eviction whether the page has been > >> active or not in its lifetime. This bit is then stored in the shadow > >> entry, to classify refaults as transitioning or thrashing. > >> > >> so I think it's fine for you to ignore when stealing a page. > > > > I have problem understanding what a workingset is. Is it related to > > "working set" is the notion of the set of pages that the workload needs to > access at the moment/relatively short time window, and it would be beneficial if > all of it could fit in the RAM. > PG_workinsgset is part of the mechanism that tries to estimate this ideal set of > pages, and especially when the workload shifts to another set of pages, in order > to guide reclaim better. See the big comment at the top of mm/workingset.c for > details > > > swap? If so, how can such a page be part of a file mapping? > > Not related to swap. It was actually first implemented only for file pages (page > cache), but then extended to anonymous pages by aae466b0052e ("mm/swap: > implement workingset detection for anonymous LRU") Thanks, yes. Think of it as similar to PG_active. It's just another usage/heat indicator of file and anon pages on the reclaim LRU that, unlike PG_active, persists across deactivation and even reclaim (we store it in the page cache / swapper cache tree until the page refaults). So if fuse accepts pages that can legally have PG_active set, PG_workingset is fine too.