Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754865AbbHCRGe (ORCPT ); Mon, 3 Aug 2015 13:06:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34608 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753466AbbHCRGb (ORCPT ); Mon, 3 Aug 2015 13:06:31 -0400 Date: Mon, 3 Aug 2015 19:04:28 +0200 From: Oleg Nesterov To: Nikolay Borisov Cc: "Linux-Kernel@Vger. Kernel. Org" , riel@redhat.com, Peter Zijlstra , Steven Rostedt Subject: Re: HARD LOCKUP: Strange hard lock up on spin_lock(&sighand->siglock); Message-ID: <20150803170428.GA18618@redhat.com> References: <55B629E9.6020207@kyup.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55B629E9.6020207@kyup.com> 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 Content-Length: 1242 Lines: 30 Sorry for delay, vacation. I'll try to re-read your email later, just one note for now... On 07/27, Nikolay Borisov wrote: > > Based on that I think could be happening is that the sighand itself is > being freed while we are in the grace period inside __lock_task_sighand > but the slab page itself is not freed as per the semantics of > SLAB_DESTROY_BY_RCU. I looked up the source of this function in the > latest kernels and saw that Oleg had put a comment clarifying the > semantics but I'm still not convinced that it is safe. What if > we are trying to lock the spinlock before this particular slab is > initialised with sighand_ctor? But this is not possible? ->sighand can never point to the uninitialized struct sighand_struct. Just in case... please note that if ->sighand was freed and then re-allocated while __lock_task_sighand() spins under rcu_read_lock(), sighand_ctor() won't be called again (due to SLAB_DESTROY_BY_RCU). Perhaps this was the source of your confusion? Oleg. -- 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/