Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4099934ybg; Fri, 25 Oct 2019 13:19:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4uUWro3klf4MRvaPg4y1THoV+9jJ7Bc7NIC1LWvN/kTuLKchDtz4mB0qgLjm8FPD6QQGx X-Received: by 2002:a50:b83d:: with SMTP id j58mr6019386ede.84.1572034764318; Fri, 25 Oct 2019 13:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572034764; cv=none; d=google.com; s=arc-20160816; b=dXDTTcmiuoJ6B/j301vs7aUjsyXsJxZQam7fmT8NcJsoFxgNORaXO1ZvqBUT6NK81b LqJlAcEqcfas3Kcao6legnBcf9OLA86bA7/WU3dMflntZAwNE6oki+SDraUflkCkwR1c UzkSrf3XRm7LBD2Ywr0GRG0BEIR1QBY+1XOdl6O3uagNA3pefg9sQRtKBMxq2dIyypE0 cINRbi95V6xhlEOUr2ruK9wsS78ms/JJhsLBQoxJGEeyUBcgkXaQKD//tUjM29WTlrgg ui2ElLZl0cL3Kf2OGH3ZRcoSgLDEMdHbm3EJNzxsdHlOizJfPeYVJPs8ED9SM7E6B/kF 0OZQ== 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=weLNTfdLz+tzcp1p5qZFFeKD4h2xJBWuXbQQ6OA86y8=; b=VgJdR+xqzFA7ocSBINgoDc3NeCLV/ewutvo59n7Ytn1Wcms849p0T4SGeySqkCRRHy suMjbQNBlrSFW211JBAi7DH0pVhndI4n07jhiCjtVEUkIsThK5c3qah0VbGDADLfG++m DG4VKeurgRUaAN+kS/w9vkKjMK8TaGnXW+A9Y5FNlP0pJEQNvMLpRRTaq/Fc4NcGWg10 Il+b4hH5hk4NKG1CMAJsmZL7cjNdbPMdC0pfRlnL5sYhAr1/PNbB+/mestVvlt9v7bZb 6V56lzSjFJPc/uxJtuoC7TymTJyDmwmWNC1XpyRrIZ9wwR+PgLDKDNRshnIDQBPNTGua 229Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 17si1700828ejt.403.2019.10.25.13.19.01; Fri, 25 Oct 2019 13:19:24 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504788AbfJYNeY (ORCPT + 99 others); Fri, 25 Oct 2019 09:34:24 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45676 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727009AbfJYNeY (ORCPT ); Fri, 25 Oct 2019 09:34:24 -0400 Received: from [213.220.153.21] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iNzj6-0004Db-9r; Fri, 25 Oct 2019 13:34:00 +0000 Date: Fri, 25 Oct 2019 15:33:59 +0200 From: Christian Brauner To: Tejun Heo , dvyukov@google.com Cc: Oleg Nesterov , Li Zefan , Johannes Weiner , akpm@linux-foundation.org, arnd@arndb.de, deepa.kernel@gmail.com, ebiederm@xmission.com, elver@google.com, guro@fb.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, cgroups@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH cgroup/for-5.5] cgroup: remove cgroup_enable_task_cg_lists() optimization Message-ID: <20191025133358.pxpzxkhqc3mboi5x@wittgenstein> References: <0000000000003b1e8005956939f1@google.com> <20191021142111.GB1339@redhat.com> <20191024190351.GD3622521@devbig004.ftw2.facebook.com> <20191025125606.GI3622521@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191025125606.GI3622521@devbig004.ftw2.facebook.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+Dmitry] On Fri, Oct 25, 2019 at 05:56:06AM -0700, Tejun Heo wrote: > On Thu, Oct 24, 2019 at 12:03:51PM -0700, Tejun Heo wrote: > > cgroup_enable_task_cg_lists() is used to lazyily initialize task > > cgroup associations on the first use to reduce fork / exit overheads > > on systems which don't use cgroup. Unfortunately, locking around it > > has never been actually correct and its value is dubious given how the > > vast majority of systems use cgroup right away from boot. > > > > This patch removes the optimization. For now, replace the cg_list > > based branches with WARN_ON_ONCE()'s to be on the safe side. We can > > simplify the logic further in the future. > > > > Signed-off-by: Tejun Heo > > Reported-by: Oleg Nesterov > > Applying to cgroup/for-5.5. The code you removed was the only place where task->flags was set from !current. So I think this fixes the syzbot data-race report in: https://lore.kernel.org/r/0000000000003b1e8005956939f1@google.com Link: syzbot+492a4acccd8fc75ddfd0@syzkaller.appspotmail.com Thanks! Christian