From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE74BC04AAF for ; Tue, 21 May 2019 20:23:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A119A2173E for ; Tue, 21 May 2019 20:23:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ByvtOV/t"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="E9cuWHFC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A119A2173E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4kcaAIaDR0H3GIEDIQLcBEDRl3VIG8RlAF/TPdFW/Qo=; b=ByvtOV/tniVCjx rQxI1bYyt65F7fqMHFv1ONJmDbs51AVL5J8Rg7Y6g9+Qo1093/P/ucM+xIgxVj1+Wv+RdXyDJYUkt Gj3WM6159SZQlkvawWIg/70emzZ4Js33l+IKrd5vm3oixEv61KB7P1x9skSgEjV8YW/xEIoYgB4eB xdVXCeOQpqhjgSBYLYCLyAnj++8YJyuWoCyBGR+ZqxkcUSCrmwNTons7s11OO1a2iHEa8FCeBbOPj 6CXwoFh0GDwj+7KQY5/BD/0ECt5rujCWhSsntIlmy/G8E31pmC8BXsGUcO92ztKdRYgPHYmvpc4XP Dt3q6OfwKin6w0R7nbAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTBIS-0000Mx-CS; Tue, 21 May 2019 20:23:40 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTBIP-0000BL-G3 for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 20:23:38 +0000 Received: by mail-lf1-x143.google.com with SMTP id x132so14117379lfd.0 for ; Tue, 21 May 2019 13:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mwA8SKkNo0NB1BSSFbQlGkhBkIi6dkzdh19hX1ggqqc=; b=E9cuWHFCD4Bgx1lOv97Ctr9bLKO3EjHQDpiZyM5FZUFuOxpsSHENK8V3oPkAEWY2CT 4OwJ0l1afyS0KlYgZEStFftLyE7H7JbMd/BnYgfS8lVdq73pcYKuqkBJcrl7o7GLJZCx 7466NcnIhfaDTvK1H+iwihEveSzhyKGC/2Zgk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mwA8SKkNo0NB1BSSFbQlGkhBkIi6dkzdh19hX1ggqqc=; b=Gw0k+yyaZC/BDIxn6PL4ozUGQtCUl/pZ2SXE9xh9WSR/cPT4g6kPJ1Cq2Z5wLG8pSH xHT7BaJ5AVq+tfGs/b+Iwm7rrK7RyPyA/kP+HOR1EqQjYuLIutAs7iZ+wSSq1BAA2QA4 VabxOxmIJubLErVbVVsePRPtIzM2kn1GrJOprjhY7eFkq+Qr8f0Cf2DNRfBtexX5gusm 9idPvLLQLQVuzEkUT05k80zKmS3uf1ecZCmgO/yPG/VjJR5O8ojspfveQi42Aj1zLfe4 QPjyfwIzMMOpyeAvqU8f/5xq8sJAlxBsyF+bj5KJc2iEcsnNh2qWOL5mHHkiu60t+EGh OzPQ== X-Gm-Message-State: APjAAAU69nfEIC2abKWRkpTmFFHKj3UkojCEdCWO3+H9XieJQisto3Ga RwfPtljyMLmXK/RnZCyOMiBLPqoq4UE= X-Google-Smtp-Source: APXvYqyD5+vkCllgYKnKQlf/gFDeZd0h1XwKz8+McY4j7zV1du+vAE0UyNNVgHc0toOpBmVgS1X0Ug== X-Received: by 2002:a19:ccca:: with SMTP id c193mr40774771lfg.36.1558470210582; Tue, 21 May 2019 13:23:30 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id y17sm1438451lji.66.2019.05.21.13.23.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 13:23:29 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id j24so12911ljg.1 for ; Tue, 21 May 2019 13:23:29 -0700 (PDT) X-Received: by 2002:a2e:2f03:: with SMTP id v3mr4725518ljv.6.1558470208997; Tue, 21 May 2019 13:23:28 -0700 (PDT) MIME-Version: 1.0 References: <20190521150006.GJ17978@ZenIV.linux.org.uk> <20190521113448.20654-1-christian@brauner.io> <28114.1558456227@warthog.procyon.org.uk> <20190521164141.rbehqnghiej3gfua@brauner.io> In-Reply-To: <20190521164141.rbehqnghiej3gfua@brauner.io> From: Linus Torvalds Date: Tue, 21 May 2019 13:23:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] open: add close_range() To: Christian Brauner X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190521_132337_543650_D489A2CD X-CRM114-Status: GOOD ( 10.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, Linux-sh list , Oleg Nesterov , David Howells , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux@vger.kernel.org, Shuah Khan , linux-arch , linux-s390 , Miklos Szeredi , the arch/x86 maintainers , linux-mips@vger.kernel.org, linux-xtensa@linux-xtensa.org, tkjos@android.com, Arnd Bergmann , Jann Horn , linux-m68k , Al Viro , Thomas Gleixner , "Dmitry V. Levin" , Linux ARM , Florian Weimer , linux-parisc@vger.kernel.org, Linux API , Linux List Kernel Mailing , alpha , linux-fsdevel , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 21, 2019 at 9:41 AM Christian Brauner wrote: > > Yeah, you mentioned this before. I do like being able to specify an > upper bound to have the ability to place fds strategically after said > upper bound. I suspect that's the case. And if somebody really wants to just close everything and uses a large upper bound, we can - if we really want to - just compare the upper bound to the file table size, and do an optimized case for that. We do that upper bound comparison anyway to limit the size of the walk, so *if* it's a big deal, that case could then do the whole "shrink fdtable" case too. But I don't believe it's worth optimizing for unless somebody really has a load where that is shown to be a big deal. Just do the silly and simple loop, and add a cond_resched() in the loop, like close_files() does for the "we have a _lot_ of files open" case. Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel