Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752172AbaLNAPA (ORCPT ); Sat, 13 Dec 2014 19:15:00 -0500 Received: from mail-qc0-f180.google.com ([209.85.216.180]:49076 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbaLNAO7 (ORCPT ); Sat, 13 Dec 2014 19:14:59 -0500 MIME-Version: 1.0 In-Reply-To: <20141213234730.GP22149@ZenIV.linux.org.uk> References: <20141212185454.GB4716@redhat.com> <20141213165915.GA12756@redhat.com> <20141213223616.GA22559@redhat.com> <20141213233508.GN22149@ZenIV.linux.org.uk> <20141213234730.GP22149@ZenIV.linux.org.uk> Date: Sat, 13 Dec 2014 16:14:58 -0800 X-Google-Sender-Auth: HVzTMdUhW3T8C40OLkYhQdAqEcQ Message-ID: Subject: Re: frequent lockups in 3.18rc4 From: Linus Torvalds To: Al Viro Cc: Dave Jones , Chris Mason , Mike Galbraith , Ingo Molnar , Peter Zijlstra , =?UTF-8?Q?D=C3=A2niel_Fraga?= , Sasha Levin , "Paul E. McKenney" , Linux Kernel Mailing List , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 13, 2014 at 3:47 PM, Al Viro wrote: > > static inline void mnt_dec_writers(struct mount *mnt) > { > #ifdef CONFIG_SMP > this_cpu_dec(mnt->mnt_pcp->mnt_writers); > #else > mnt->mnt_writers--; > #endif > } > It's load/modify/store, without any kind of atomicity; get preempted in the > middle of that sequence by another caller of mnt_dec_writers() and obvious bad > things will happen... Ugh, yes ok, the UP case needs it for the actual counter itself. Ugh. What an ugly mess. I'd rather have the preemption disable where it is actually *needed*, in that function itself for the UP case (or just make it "atomic_t", which would likely be better still. Linus -- 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/