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=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 10DE5C433DF for ; Tue, 18 Aug 2020 01:25:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1CF3207BB for ; Tue, 18 Aug 2020 01:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597713941; bh=UN/Irk0WMGhahDxHhCFhnMBwEpK3nk1NBmdMtCISZhk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=NoFCCdZzPFGSwh+8n23rArJBqO3mWQYjtOJ9tXAVw7acXbb4/olbpIhB8WF7fLkS3 NQy2jRAYgRjN1O6ixvqydqbQzHf+WX8Mbo25zSYiS8DkOECTrxop50BXao2FHzRWv9 zDo+to+7frIluOmiUxdVaX7VnR/fZYvuO1XA3+Ds= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbgHRBZl (ORCPT ); Mon, 17 Aug 2020 21:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgHRBZk (ORCPT ); Mon, 17 Aug 2020 21:25:40 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7689AC061389 for ; Mon, 17 Aug 2020 18:25:40 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id i10so19584149ljn.2 for ; Mon, 17 Aug 2020 18:25:40 -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=jO6k+zx2QyYG7TMnQ5c6/6yeQvSBLn9YZjhaXafaPvk=; b=eHsDhhag9rrcZCLW4PVvHzOSXn+lP4FTzkwXO8QbMaXFsoRdcItDm4EaUIv9k9Eayj DrMKFoyqJ82ML0/jpilgEzHE0oovbm1sqBsCjmoGO2+tOR9O7zFUyZoSgpXghA0LrnSJ pzyGN+EBFFdYxkC7yV+8bD6gAtHXA0066kioo= 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=jO6k+zx2QyYG7TMnQ5c6/6yeQvSBLn9YZjhaXafaPvk=; b=duDPBbhuw5wA/oanokW2PXNJIJ0s1RRugZFNzGIQErGywleMMa8h34C6Ii8b96NH/C 4is6DH3q1yTUT4CCc3sufHnQjmQYtLIqhCB/OBThfDXr6NMJIVp7hpbobKYlulOdx6gE 0Ln4jaLWGm1sn5ZiVJJ6Y3xiqkZbrpPCdP8Py9klSMR3dVoj+e64fg8Q8uMxGLBzAnfj v0IqfzPkoWMr1Up1Mgp8Z0b2/b8aCUO2K1lMe65r/c1s+u9frKCbfD9HYNIPgxpbf4Xw LVXkgJ5smriPv1nUBaeERWnxcqsVCBY1DYNm+Vybp3jGv8CI9hu0XGILEzwdVuh5UNxY veDA== X-Gm-Message-State: AOAM530stKKhX40Y4GmqCRNzN7SoWL+4MhESs/T+QiYyMnDLphZV1BEE QiV9UFl7LZEUjLwFRTfOyEb5oB3P82RH1Q== X-Google-Smtp-Source: ABdhPJyzJQRQ++lf+kF5Ey1vH8iTGJ4bG4GuRAoFhGzOvLsV+hzQeNg5yGJaVrCV6pxT8cT5YLZclQ== X-Received: by 2002:a2e:8589:: with SMTP id b9mr8434882lji.126.1597713938718; Mon, 17 Aug 2020 18:25:38 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id x13sm5962515lfr.95.2020.08.17.18.25.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Aug 2020 18:25:38 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id 185so19540887ljj.7 for ; Mon, 17 Aug 2020 18:25:38 -0700 (PDT) X-Received: by 2002:a05:651c:503:: with SMTP id o3mr9127085ljp.312.1597713472024; Mon, 17 Aug 2020 18:17:52 -0700 (PDT) MIME-Version: 1.0 References: <87ft8l6ic3.fsf@x220.int.ebiederm.org> <20200817220425.9389-9-ebiederm@xmission.com> <875z9g7oln.fsf@x220.int.ebiederm.org> In-Reply-To: <875z9g7oln.fsf@x220.int.ebiederm.org> From: Linus Torvalds Date: Mon, 17 Aug 2020 18:17:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/17] file: Implement fnext_task To: "Eric W. Biederman" Cc: Linux Kernel Mailing List , "" , criu@openvz.org, bpf , Alexander Viro , Christian Brauner , Oleg Nesterov , Cyrill Gorcunov , Jann Horn , Kees Cook , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , 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 Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Mon, Aug 17, 2020 at 6:06 PM Eric W. Biederman wrote: > > I struggle with the fcheck name as I have not seen or at least not > registed on the the user that just checks to see if the result is NULL. > So the name fcheck never made a bit of sense to me. Yeah, that name is not great. I just don't want to make things even worse. > I will see if I can come up with some good descriptive comments around > these functions. Along with describing what these things are doing I am > thinking maybe I should put "_rcu" in their names and have a debug check > that verifies "_rcu" is held. Yeah, something along the lines of "rcu_lookup_fd_task(tsk,fd)" would be a *lot* more descriptive than fcheck_task(). And I think "fnext_task()" could be "rcu_lookup_next_fd_task(tsk,fd)". Yes, those are much longer names, but it's not like you end up typing them all that often, and I think being descriptive would be worth it. And "fcheck()" and "fcheck_files()" would be good to rename too along the same lines. Something like "rcu_lookup_fd()" and "rcu_lookup_fd_files()" respectively? I'm obviously trying to go for a "rcu_lookup_fd*()" kind of pattern, and I'm not married to _that_ particular pattern but I think it would be better than what we have now. Linus