Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754177AbbHYCA4 (ORCPT ); Mon, 24 Aug 2015 22:00:56 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:36728 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbbHYCAz (ORCPT ); Mon, 24 Aug 2015 22:00:55 -0400 MIME-Version: 1.0 X-Originating-IP: [122.106.150.15] In-Reply-To: <20150824184507.GB28944@mtj.duckdns.org> References: <1440335432-4202-1-git-send-email-cyphar@cyphar.com> <1440335432-4202-2-git-send-email-cyphar@cyphar.com> <20150824184507.GB28944@mtj.duckdns.org> Date: Tue, 25 Aug 2015 12:00:54 +1000 Message-ID: Subject: Re: [PATCH 1/2] cgroup: get a ref to source csses when migrating From: Aleksa Sarai To: Tejun Heo Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1170 Lines: 27 > Have you verified that the scenario you're describing can actually > happen? AFAICS, cgroup_migrate_add_src() already does the pinning. Hmmm. Looking at it, group_migrate_add_src() does grab a ref on the css_set which contains the css, and the comments mention that grabbing a ref on the css_set will stop the css from being dropped. I must've misunderstood one of your previous emails (where you said that such code was not safe in the ->can_fork(), ->cancel_fork() and ->fork()) path. You also mentioned that depending on the css_set's ref being bumped to protect the contained csses is "sort of implementation detail. It can be implemented in different ways." Which made me think that depending on that is not a good idea. But if it's safe to depend on the cgroup_migrate_add_src() pinning the ref on the css_set, I'll drop this patch and fix up the other one accordingly. -- Aleksa Sarai (cyphar) www.cyphar.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/