Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbbDTRPa (ORCPT ); Mon, 20 Apr 2015 13:15:30 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:33511 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbbDTRP2 (ORCPT ); Mon, 20 Apr 2015 13:15:28 -0400 Message-ID: <1429550126.7346.268.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install From: Eric Dumazet To: Mateusz Guzik Cc: Al Viro , Andrew Morton , "Paul E. McKenney" , Yann Droneaud , Konstantin Khlebnikov , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 20 Apr 2015 10:15:26 -0700 In-Reply-To: <20150420151054.GD2513@mguzik> References: <20150416121628.GA20615@mguzik> <1429307216.7346.255.camel@edumazet-glaptop2.roam.corp.google.com> <20150417221646.GA15589@mguzik> <20150417230252.GE889@ZenIV.linux.org.uk> <20150420130633.GA2513@mguzik> <20150420134326.GC2513@mguzik> <20150420151054.GD2513@mguzik> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1222 Lines: 30 On Mon, 2015-04-20 at 17:10 +0200, Mateusz Guzik wrote: > Sorry for spam but I came up with another hack. :) > > The idea is that we can have a variable which would signify the that > given thread is playing with fd table in fd_install (kind of a lock > embedded into task_struct). We would also have a flag in files struct > indicating that a thread would like to resize it. > > expand_fdtable would set the flag and iterate over all threads waiting > for all of them to have the var set to 0. The opposite : you have to block them in some way and add a rcu_sched() or something. Another way would be to expand the table leaving the old one in place, thanks to a new vrealloc() api. This would require all file tables to at least use one page. (Instead of use a new set of pages for the new vmalloc()ed area, reuse the pages that are already mapped into previous vmalloc() area. Right now, expanding 4M slots to 8M slots is taking a long time and is a latency killer. -- 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/