linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Tejun Heo <tj@kernel.org>
Cc: "Roman Gushchin" <guro@fb.com>,
	"Michal Koutný" <mkoutny@suse.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Kernel Team" <Kernel-team@fb.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm()
Date: Fri, 15 Nov 2019 19:03:03 +0100	[thread overview]
Message-ID: <20191115180303.GC15216@dhcp22.suse.cz> (raw)
In-Reply-To: <20191115174844.GR4163745@devbig004.ftw2.facebook.com>

On Fri 15-11-19 09:48:44, Tejun Heo wrote:
> On Fri, Nov 15, 2019 at 06:47:21PM +0100, Michal Hocko wrote:
> > s@online@offline@
> > 
> > And reading after myself it turned out to sound differently than I
> > meant. What I wanted to say really is, what is the difference that
> > css_tryget_online really guarantee when the css might go offline right
> > after the call suceeds so more specifically what is the difference
> > between
> > 	if (css_tryget()) {
> > 		if (online)
> > 			DO_SOMETHING
> > 	}
> > and
> > 	if (css_tryget_online()) {
> > 		DO_SOMETHING
> > 	}
> > 
> > both of them are racy and do not provide any guarantee wrt. online
> > state.
> 
> It's about not giving new reference when the object is known to be
> delted to the user.

This part is clear to me. The failure just says it is already too late
to do anything. I just still struggle why the success is telling me much
more when the state might change before I can do anything on the object.
I could see a usefulness if I've had a guarantee that the object stays
online while I hold a $FOO lock but if there is nothing like that then 
we are just having already too late or potentially too late.

Anyway it's been a hard week and the brain is just going for the weekend
so I just might be dense now.

> Can you please think more about how file deletions work?

I will try that with a fresh brain next week.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2019-11-15 18:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 22:51 [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Roman Gushchin
2019-11-06 22:51 ` [PATCH 2/2] mm: hugetlb: switch to css_tryget() in hugetlb_cgroup_charge_cgroup() Roman Gushchin
2019-11-07  0:26   ` Johannes Weiner
2019-11-07  2:31   ` Shakeel Butt
2019-11-07 15:44   ` Tejun Heo
2019-11-07  0:22 ` [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Johannes Weiner
2019-11-07  1:25   ` Shakeel Butt
2019-11-07  1:43     ` Johannes Weiner
2019-11-07  1:43     ` Roman Gushchin
2019-11-07  2:21       ` Shakeel Butt
2019-11-07  2:28         ` Shakeel Butt
2019-11-07 12:21 ` Michal Hocko
2019-11-07 15:43   ` Tejun Heo
2019-11-07 16:42   ` Roman Gushchin
2019-11-07 17:02     ` Michal Hocko
2019-11-07 22:41       ` Roman Gushchin
2019-11-08  8:53         ` Michal Hocko
2019-11-07 15:43 ` Tejun Heo
2019-11-13 16:29 ` Michal Koutný
2019-11-13 17:08   ` Roman Gushchin
2019-11-14 19:16     ` Michal Hocko
2019-11-14 19:20       ` Tejun Heo
2019-11-14 19:33         ` Michal Hocko
2019-11-14 19:37           ` Tejun Heo
2019-11-15 17:40             ` Michal Hocko
2019-11-15 17:45               ` Tejun Heo
2019-11-15 17:47               ` Michal Hocko
2019-11-15 17:48                 ` Tejun Heo
2019-11-15 18:03                   ` Michal Hocko [this message]
2019-11-15 18:07                 ` Roman Gushchin
2019-11-18  9:43                   ` Michal Hocko
2019-11-15 18:13       ` Roman Gushchin
2019-11-21 15:28     ` Michal Koutný
2019-11-22  8:20       ` Michal Hocko

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=20191115180303.GC15216@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=Kernel-team@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mkoutny@suse.com \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).