From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753574AbdKGTpm (ORCPT ); Tue, 7 Nov 2017 14:45:42 -0500 Received: from mail-io0-f169.google.com ([209.85.223.169]:43771 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbdKGTpk (ORCPT ); Tue, 7 Nov 2017 14:45:40 -0500 X-Google-Smtp-Source: ABhQp+Snbj+uqAWl+0HIpMFj2gu5QJcKFYXtBcLd0qzAAqhOmBykDC+r8mdn1WHwQu9BWyNSdTS5hQ== Subject: Re: [PATCH V2] kthread: zero the kthread data structure To: Shaohua Li , LKML Cc: Andrew Morton , Ingo Molnar , Tejun Heo , Dmitry Vyukov References: From: Jens Axboe Message-ID: Date: Tue, 7 Nov 2017 12:45:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/07/2017 12:09 PM, Shaohua Li wrote: > kthread() could bail out early before we initialize blkcg_css (if the > kthread is killed very early. Please see xchg() statement in kthread()), > which confuses free_kthread_struct. Instead of moving the blkcg_css > initialization early, we simply zero the whole 'self' data structure, > which doesn't sound much overhead. Applied, thanks Shaohua. -- Jens Axboe