Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4787986ybc; Fri, 15 Nov 2019 10:04:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxlu6CqgwyCH38qTWDcwFYGONrFll6LqNFzb+bM/xrF26L3lbtIaJZVkcXqalcoCUhmpAn/ X-Received: by 2002:a1c:9e10:: with SMTP id h16mr15796885wme.91.1573841080792; Fri, 15 Nov 2019 10:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573841080; cv=none; d=google.com; s=arc-20160816; b=VVzqiDy0YcVmEd/M95dfxP33guyD7PWJ0/Ccg7I8OHB0QmKLYbVDQcPpwDZNrz2Ynm pAIVx9h0Zz1/mkMRhzJsXy3Me86KAQq2yPorieM2zMWkzA5zhoyoqJw+Gv33r7xKWxvy 0NzdOZ3gLx+Q078+rZ9j9RaXOvl6CgV/kkORqQfK+nmxzbjway4mmVMREkMBxAMFLsup JOPj6wwcLL7Z1eEt5y7JIQgIp4UDSa7KLk8sk4CleIKGdwmcnfyYdqqEAhMtqBhALFHn iB822PNUtAa5gDsgCrrnJhTPYdVtDjuY7CmvMiKk0oXzpQIatDC1JZxK1hHi3X738wnp sCag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SPNS/g/5ANv5SE9hMfaKtIuhelWZYwtMyme9I52qXkY=; b=GJaXD9Os9ng9wV+e1KWOFO7WUCKd3bVS+H6RSXYly8VepY6hqLAOT/2YTbvAfIq/Cn 4efDkn3c388eF2zYMLld69/X0awcyKYWplxAQXnpsmMAnw0SlD3i9yQz/ONIDy+5VoOF cEnnitDboMvZz9Y7ap1wIDx1WcFHFz5nyTNnG5K+GHPpNAhnnN+7uh5qsn3Qtxo7D6Le V6mL2z7cdIm2sZT+ngag/fNpNBuAyfcR1qWf2Ndq9aWxnpFV/QsBbj7nY0In/JAoQs63 bEpOZHDPAyf+vX3fYNYJu8UzhKyZ0FAqZAzLLc/UYze6NHzgemE3SO5CfKcwQqelJ3a0 Kd2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si7955317ede.45.2019.11.15.10.04.15; Fri, 15 Nov 2019 10:04:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726567AbfKOSDG (ORCPT + 99 others); Fri, 15 Nov 2019 13:03:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:44928 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725907AbfKOSDG (ORCPT ); Fri, 15 Nov 2019 13:03:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 46E8EB9DB; Fri, 15 Nov 2019 18:03:04 +0000 (UTC) Date: Fri, 15 Nov 2019 19:03:03 +0100 From: Michal Hocko To: Tejun Heo Cc: Roman Gushchin , Michal =?iso-8859-1?Q?Koutn=FD?= , "linux-mm@kvack.org" , Andrew Morton , Johannes Weiner , "linux-kernel@vger.kernel.org" , Kernel Team , "stable@vger.kernel.org" Subject: Re: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Message-ID: <20191115180303.GC15216@dhcp22.suse.cz> References: <20191106225131.3543616-1-guro@fb.com> <20191113162934.GF19372@blackbody.suse.cz> <20191113170823.GA12464@castle.DHCP.thefacebook.com> <20191114191657.GN20866@dhcp22.suse.cz> <20191114192018.GJ4163745@devbig004.ftw2.facebook.com> <20191114193340.GA24848@dhcp22.suse.cz> <20191114193736.GL4163745@devbig004.ftw2.facebook.com> <20191115174031.GA15216@dhcp22.suse.cz> <20191115174721.GB15216@dhcp22.suse.cz> <20191115174844.GR4163745@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115174844.GR4163745@devbig004.ftw2.facebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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