linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosryahmed@google.com>
To: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Cc: Nhat Pham <nphamcs@gmail.com>,
	linux-mm@kvack.org,  Johannes Weiner <hannes@cmpxchg.org>,
	Chengming Zhou <chengming.zhou@linux.dev>
Subject: Re: phantom memory in a cgroup (was [BUG] ZSwap leaks memory upon being disabled)
Date: Thu, 31 Oct 2024 15:04:45 -0700	[thread overview]
Message-ID: <CAJD7tkYfZjPGyWCEY2dJ_gh4iJ+UOtBO_EnRogTQHLdeCe5_eQ@mail.gmail.com> (raw)
In-Reply-To: <e8f4b9a1758f1708f9e072bd43d3bca7a47bad0f.camel@yandex.ru>

On Thu, Oct 31, 2024 at 2:59 PM Konstantin Kharlamov <Hi-Angel@yandex.ru> wrote:
>
> On Wed, 2024-10-30 at 12:44 -0700, Yosry Ahmed wrote:
> > shmem increased by a lot (~1.8G).
> >
> > So this looks like it could be the answer to your question about
> > where
> > the swap usage is coming from. I would try to find what tmpfs files
> > are used by this application.
>
> Thank you! After doing more digging I reduced it to `Xorg` having a
> hunderds of `anon_inode:i915.gem`, and afterwards pinned down this to
> be Picom not freeing resources. Reported on Github¹.
>
> That said, isn't there a kernel bug too? If this `shmem` ends up in
> Swap, then it should be accounted in `Swap` fields of
> `proc/<pid>/smaps` accordingly, right? In the end, that's what the
> field is for: amount of SWAP taken by a process. Otherwise it is a
> "phantom memory": something being in SWAP, but who owns this
> "something" — there's no way to know, it just kind of "exists" amidst
> kernel and processes realms.

I don't think so. shmem doesn't really belong to a single process. If
you kill the process but leave the tmpfs files behind, the memory will
not go away.

>
> 1: https://github.com/yshui/picom/issues/1378


  reply	other threads:[~2024-10-31 22:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 13:02 [BUG] ZSwap leaks memory upon being disabled Konstantin Kharlamov
2024-10-24 20:47 ` Yosry Ahmed
2024-10-25  6:41   ` Konstantin Kharlamov
2024-10-25  7:50     ` Yosry Ahmed
2024-10-26 11:33       ` Konstantin Kharlamov
2024-10-26 17:47         ` Yosry Ahmed
2024-10-27  0:29           ` Konstantin Kharlamov
2024-10-27  3:14             ` Nhat Pham
2024-10-27  6:46               ` Yosry Ahmed
2024-10-27 10:11                 ` Konstantin Kharlamov
2024-10-27 10:32                   ` Konstantin Kharlamov
2024-10-27 11:28                     ` Konstantin Kharlamov
2024-10-27 19:31                       ` Yosry Ahmed
2024-10-27 22:13                         ` phantom memory in a cgroup (was [BUG] ZSwap leaks memory upon being disabled) Konstantin Kharlamov
2024-10-30 14:41                           ` Konstantin Kharlamov
2024-10-30 19:44                             ` Yosry Ahmed
2024-10-31 21:59                               ` Konstantin Kharlamov
2024-10-31 22:04                                 ` Yosry Ahmed [this message]
2024-10-27 10:25               ` [BUG] ZSwap leaks memory upon being disabled Konstantin Kharlamov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJD7tkYfZjPGyWCEY2dJ_gh4iJ+UOtBO_EnRogTQHLdeCe5_eQ@mail.gmail.com \
    --to=yosryahmed@google.com \
    --cc=Hi-Angel@yandex.ru \
    --cc=chengming.zhou@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox