From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757716AbbCDODo (ORCPT ); Wed, 4 Mar 2015 09:03:44 -0500 Received: from mail.bmw-carit.de ([62.245.222.98]:46808 "EHLO mail.bmw-carit.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751326AbbCDODm (ORCPT ); Wed, 4 Mar 2015 09:03:42 -0500 Message-ID: <54F710B0.7040507@bmw-carit.de> Date: Wed, 4 Mar 2015 15:03:28 +0100 From: Daniel Wagner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jeff Layton CC: Andi Kleen , , , John Kacur , Alexander Viro , "J. Bruce Fields" Subject: Re: [RFC v1 0/5] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock References: <1424443195-18676-1-git-send-email-daniel.wagner@bmw-carit.de> <87vbiwwotb.fsf@tassilo.jf.intel.com> <54EC9FA2.1030000@bmw-carit.de> <20150224160643.1d3366d5@tlielax.poochiereds.net> <54F086CA.5060606@bmw-carit.de> <20150227103014.28defa0b@tlielax.poochiereds.net> <54F45E69.6090303@bmw-carit.de> <20150302192907.2a58ddcb@tlielax.poochiereds.net> In-Reply-To: <20150302192907.2a58ddcb@tlielax.poochiereds.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/2015 01:29 AM, Jeff Layton wrote: >> Hmm, are you sure about that? I read the code this way that when a lock >> is added to flock_list it stays on that CPU. The locks are not moved >> from one flock_list to another during their existent. >> > > Yes, I'm sure. When a file lock is acquired, we assign the fl_link_cpu > to the current CPU and add it to the current CPU's global list. When > the lock is released, any blocked lock that might have been blocking on > it could acquire it at that point, and that doesn't necessarily occur > on the same CPU as where the lock was originally held. > > So, it's entirely possible that between when you drop the spinlock on > one CPU and pick it up on another, the lock could have been released > and then reacquired on a different CPU. D'oh. I am an idiot. I didn't really understand it the first time. Yes, you are right. cheers, daniel