From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061AbbIGRwH (ORCPT ); Mon, 7 Sep 2015 13:52:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34510 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753999AbbIGRwB (ORCPT ); Mon, 7 Sep 2015 13:52:01 -0400 Date: Mon, 7 Sep 2015 19:49:14 +0200 From: Oleg Nesterov To: Petr Mladek Cc: Steven Rostedt , Andrew Morton , Tejun Heo , Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm@kvack.org, Vlastimil Babka , live-patching@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 10/14] ring_buffer: Fix more races when terminating the producer in the benchmark Message-ID: <20150907174914.GA2148@redhat.com> References: <1438094371-8326-1-git-send-email-pmladek@suse.com> <1438094371-8326-11-git-send-email-pmladek@suse.com> <20150803143323.426ea2fc@gandalf.local.home> <20150904093856.GI22739@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150904093856.GI22739@pathway.suse.cz> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, I didn't read these emails, and I never looked at this code... Can't understand what are you talking about but a minor nit anyway ;) On 09/04, Petr Mladek wrote: > > + __set_current_state(TASK_RUNNING); > if (!kthread_should_stop()) > wait_to_die(); I bet this wait_to_die() can die, consumer/producer can simply exit. Just you need get_task_struct() after kthread_create(), and put_task_struct() after kthread_stop(). Oleg.