Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2987510pxa; Tue, 18 Aug 2020 03:37:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKZzQaNsLh//0/uTgNO7YiyzruwoFtudc+u0s0cJYwjxQgAnEmRXGhRf0THd/0qVLLefaA X-Received: by 2002:a50:bae6:: with SMTP id x93mr18931034ede.79.1597747075200; Tue, 18 Aug 2020 03:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597747075; cv=none; d=google.com; s=arc-20160816; b=idNwAJTI4Lp54DayGeoxf7rK638mOpqgFabMl57B/OV3XXp6x3acnZsmfGrC6NzXLp LCfIOekgTnqV+EVCNjZsE0b4EzNuj6BA67LPC21fu9pbcwQuOBZuZ1ZI4j2cqPaEfu2d h1LRnHZULGoSFr2rW1YHKoIBoTx3cQ0rQ/Zi++9QlwGFB6/m1fx74Mtp1UPC+Fk39Z37 DEFXKanhFjhpBSbkHB8cl75S6Jl1VEbnSZ/oEkc3+Ea0VFePSRR0fDwNUCSYrxYGNYk1 wqNPhxKgMF5UpKcSeSagZImVGzgmvGt1xpomUTkvd2eqE/onVvWH1hzcpCGIEHvse6Jm ZSaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SalWHFs/4T9tSeAm36YUYuR9I0hEQiIB+YXgCBRSyI4=; b=o+fOHZPMo+4fPKVoWDKLmDAAlVtYZsllI/AabJ80V5dDtEVWU3iWRjR+lv43TdbKuC aLnKbX2YqbIQCvnl8w+DgnFXTGNbONc7OWGXpvC17z0cMdWglV0gXn30YQkAWS4BZf/2 G+fgtF06ZiIs49XtStiDitqaGM0tTATIeCo5lsmaBFEV3mwkICn5orZCOECePU0CMLE0 HdhGhAaHbvNsERMhi4ab68XYMQpA5sjP4j/wRiu/asJMNcDnZeJOtJlqDi72KqTWtaOq 1tf54uasGUgymhMtdPIgE36MhZgz5D2uxSdLNmf7dzf1ebS2M2Py6FfEkkzAvxHNBEZK SgYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si13460295eds.68.2020.08.18.03.37.31; Tue, 18 Aug 2020 03:37:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbgHRKgt (ORCPT + 99 others); Tue, 18 Aug 2020 06:36:49 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39051 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbgHRKgr (ORCPT ); Tue, 18 Aug 2020 06:36:47 -0400 Received: from ip5f5af70b.dynamic.kabel-deutschland.de ([95.90.247.11] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k7yyz-00031p-RM; Tue, 18 Aug 2020 10:36:45 +0000 Date: Tue, 18 Aug 2020 12:36:44 +0200 From: Christian Brauner To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, criu@openvz.org, bpf@vger.kernel.org, Linus Torvalds , Alexander Viro , Oleg Nesterov , Cyrill Gorcunov , Jann Horn , Kees Cook , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , Jeff Layton , Miklos Szeredi , Matthew Wilcox , "J. Bruce Fields" , Matthew Wilcox , Trond Myklebust , Chris Wright , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh Subject: Re: [PATCH 07/17] proc/fd: In tid_fd_mode use fcheck_task Message-ID: <20200818103644.rsb3vvrkuyoen4nj@wittgenstein> References: <87ft8l6ic3.fsf@x220.int.ebiederm.org> <20200817220425.9389-7-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200817220425.9389-7-ebiederm@xmission.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 17, 2020 at 05:04:15PM -0500, Eric W. Biederman wrote: > When discussing[1] exec and posix file locks it was realized that none > of the callers of get_files_struct fundamentally needed to call > get_files_struct, and that by switching them to helper functions > instead it will both simplify their code and remove unnecessary > increments of files_struct.count. Those unnecessary increments can > result in exec unnecessarily unsharing files_struct which breaking > posix locks, and it can result in fget_light having to fallback to > fget reducing system performance. > > Using fcheck_task instead of get_files_struct clarifies tid_fd_mode by > removing a step. > > [1] https://lkml.kernel.org/r/20180915160423.GA31461@redhat.com > Suggested-by: Oleg Nesterov > Signed-off-by: "Eric W. Biederman" > --- Acked-by: Christian Brauner