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=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 2E3E8C5DF60 for ; Thu, 7 Nov 2019 15:44:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9BC42178F for ; Thu, 7 Nov 2019 15:44:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="POhLYOxu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9BC42178F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 880086B000A; Thu, 7 Nov 2019 10:44:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 857F16B000D; Thu, 7 Nov 2019 10:44:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76E386B000E; Thu, 7 Nov 2019 10:44:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id 638826B000A for ; Thu, 7 Nov 2019 10:44:16 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 19C51443F for ; Thu, 7 Nov 2019 15:44:16 +0000 (UTC) X-FDA: 76129902912.01.night41_42515cce20c51 X-HE-Tag: night41_42515cce20c51 X-Filterd-Recvd-Size: 4141 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Nov 2019 15:44:15 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id e2so2368708qkn.5 for ; Thu, 07 Nov 2019 07:44:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/VLsWSGCw7M78G2ciEeMt8ki0nUc+nWXcIjdygNoX4M=; b=POhLYOxufAI7xHlzUJDemniGTcznmIvhHjolHRByJVTX3xroAktxe3C1Liz/KxCXZ6 6VaC61mFQW0hAuUJlPxrGVCEzcw2PkEKtvRl/1fnuD/Ag6A7t5p/cwE6gBWJptUI60Vk e7V9SH8Fe3pHCGnaPrPWX7HMYocKHMr/nJa2UcRmmpYynv24nKSwcNzkqdvw5fc3xFTW 5DPNQz2AZIX8ZEgYZhdcp2jrSvcUALboEuXkf5JBt1iEZtM7OLE1rgbj767PvQ1fMnAO ROaVcKgdglj5gXWKGQh0RjoC5feo/Iv3LeIPq0C2wwP1PXRpKv+wFE0bxrGEw5cPehHw DYnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/VLsWSGCw7M78G2ciEeMt8ki0nUc+nWXcIjdygNoX4M=; b=fx2Bl4OCdixWbuuZWlekv+XtdHARAbTmCd50gzpZBDm0qkBsny577qwjseEaltkWNL gCRcx60NxFqEe6AUZ9zmXySIqiJ5o5qwWv8PhbMEs1+MhIVGUboO6fHjrdqwXd13qVG8 zi8YXt5KnLT4arkW7Wk9QVDLq6CCBbi7j2eFiw6mzOid1YsoW3XfyCf5TZHOz1LrffQt p+l2FOHQUynIp53hXDz9IxE+8LWJuYGOVbCZ5PkePa66DvjZzTColiQeJZnusm88XD1L 8/OUTovX0tcAmlWfojLGAJAfZZmYZc+ouoCX9KsJkdEBAl1bbE27zGFJPlxqFY8oYi/l YDAQ== X-Gm-Message-State: APjAAAW4hk6DlFQrqU5PwuORgDmoFNfSh3qLBGO9CU971hvBCR+E7UTe Vo3xHZndggXNpwF5RhvlhcM= X-Google-Smtp-Source: APXvYqynNCHiUDdEWnZVcJRvtZWFE3Xbj5ykMaCKEADa4CIKtYZS7E5JETW/Bpzi8CvOCLGCFF7hug== X-Received: by 2002:a37:a950:: with SMTP id s77mr3448271qke.463.1573141454976; Thu, 07 Nov 2019 07:44:14 -0800 (PST) Received: from localhost ([2620:10d:c091:500::2:3f13]) by smtp.gmail.com with ESMTPSA id 19sm1330971qkg.89.2019.11.07.07.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2019 07:44:14 -0800 (PST) Date: Thu, 7 Nov 2019 07:44:13 -0800 From: Tejun Heo To: Roman Gushchin Cc: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Johannes Weiner , linux-kernel@vger.kernel.org, kernel-team@fb.com, stable@vger.kernel.org Subject: Re: [PATCH 2/2] mm: hugetlb: switch to css_tryget() in hugetlb_cgroup_charge_cgroup() Message-ID: <20191107154413.GZ3622521@devbig004.ftw2.facebook.com> References: <20191106225131.3543616-1-guro@fb.com> <20191106225131.3543616-2-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191106225131.3543616-2-guro@fb.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 06, 2019 at 02:51:31PM -0800, Roman Gushchin wrote: > An exiting task might belong to an offline cgroup. In this case > an attempt to grab a cgroup reference from the task can end up > with an infinite loop in hugetlb_cgroup_charge_cgroup(), because > neither the cgroup will become online, neither the task will > be migrated to a live cgroup. > > Fix this by switching over to css_tryget(). As css_tryget_online() > can't guarantee that the cgroup won't go offline, in most cases > the check doesn't make sense. In this particular case users of > hugetlb_cgroup_charge_cgroup() are not affected by this change. > > A similar problem is described by commit 18fa84a2db0e ("cgroup: Use > css_tryget() instead of css_tryget_online() in task_get_css()"). > > Signed-off-by: Roman Gushchin > Cc: stable@vger.kernel.org > Cc: Tejun Heo Acked-by: Tejun Heo Thanks. -- tejun