Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1163669ybv; Thu, 20 Feb 2020 14:34:25 -0800 (PST) X-Google-Smtp-Source: APXvYqwL/qM6YUAdiOHNkA1EdlJ8FwKfqwSkwAM667ryFXuD04rt3J9GL3yIfnMT5pfmBt1VMb6o X-Received: by 2002:a9d:66c1:: with SMTP id t1mr22997775otm.73.1582238064846; Thu, 20 Feb 2020 14:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582238064; cv=none; d=google.com; s=arc-20160816; b=juySSN0K4s3dKILvNa7Y5LHTePpwxFvcT0YDRb8uVSgiBJmlEpNLEl55elTYypwFwd Pp8TijyWTgCJyq+H6u+GJYp03RRAVHNjTKr28EUIMKChivooCXXDAYZo2w7t/dIGceXU 253KD8UMFBlu/NYKFomtGHc8zKYYPTU5H6TtiQj6SXvKoTcKtwB8eqAFbSnzvqfLwZs0 wXlL//VRwnh68K03sFTL8wszNibGCrkBIE4xLbp3nzfbTCBen4yFqcc9JbapKBnGY1Wb clTBNnIgjfla1f5/sKpiXAkum/jrKGXLhS2/OTbWO+ZSJBqZhtArUIvmIeCKWtJXTVMV DVKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WrNmlOpMVxzFXh2A2oJzXRWZK2fGDe1+SPIAN4gWybk=; b=aoqd+Sx7ffwEe+ir5mpEpaBsD7JhIisPIy/komrr6fO1MSQmJ8GInFlKPLnwrPLvnk NHegLCUMleALXrW0RPUzz3YgfERIQ/VzjR7Gz3wDgWOYv5d8sh8s/dBDgmmBNUlTUJiF zS2qSQt1cgIm8RIpxkMFHi+5C+fIQ5rlkqhBOPdnTjPOxTzD1y/AwW0amXIXZTaWboCO ErZIrpCXMFfLQxtD6gqo0Q//ziwhArY7cI8qk3TYYRR7ngJCMhJp1EXV5RufPgdmBJYB pBFPSOJJo+pZ3b/PF85bmxWPnw8rG9bc4Qf6cS9xOMn7imNfxYI3vBerUgOnxPIVHolk 7C3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QiMLUGsR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si399142otq.121.2020.02.20.14.34.10; Thu, 20 Feb 2020 14:34:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QiMLUGsR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729258AbgBTWdb (ORCPT + 99 others); Thu, 20 Feb 2020 17:33:31 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37319 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729109AbgBTWda (ORCPT ); Thu, 20 Feb 2020 17:33:30 -0500 Received: by mail-lf1-f68.google.com with SMTP id b15so532lfc.4 for ; Thu, 20 Feb 2020 14:33:29 -0800 (PST) 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=WrNmlOpMVxzFXh2A2oJzXRWZK2fGDe1+SPIAN4gWybk=; b=QiMLUGsRq9HWg+G+gXiEaS3g8vcEPOTXS0nkdYQXIsCA2EjphiI1+TGu1HVJ3od+BY 4nIUXqbNSwvfL1zzmPatevn6ccupRjp+aZGa5eL8bOeMqUiv7Bg7Hz5IKilERFOA99sS jMLLQ3OrRmjEMgFi9TJzZnDfd0rXWYetgu1bs= 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=WrNmlOpMVxzFXh2A2oJzXRWZK2fGDe1+SPIAN4gWybk=; b=cpKkUYiNwidk7Blo16tT7rz1FB5tA6QCfEjuQkWVkx4ED65qzPeRCKLf+Tn8P5RxSw Hn3Sg0Ul1rcLbf6BjyyyqAsdPZYKB1pFieyNIeFdsKDTmMKbtuslPJy70fHUFbwYlLyf roeLNufDzeR5h3soVE3DEGjP3sL5qXGjq63Cn7XVbOg7VmJqWuIywf7DUFrgVWSVQFby 52L+G4rUa8jhuIWQO8f6WIeoUbT7X6JD1lWWBd2AdFAelCSryo9laOQ63zqy8fIHJ3y9 hWlA0npb6dpmopPDFH0+U8CBEteM91AegkJZAMG1Th21S+pjrjz3P2MBL9Wxycjqe6/w Mvxw== X-Gm-Message-State: APjAAAUDZueqMfgHrk1UvIW361rJHF1ZR5dfde2/4cv3LXuC/ejFk+6h 4SbyTvqJpXXGEFnSKiYFF8frZCnJGZ8= X-Received: by 2002:a05:6512:31c3:: with SMTP id j3mr2554120lfe.144.1582238008271; Thu, 20 Feb 2020 14:33:28 -0800 (PST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id l1sm475804lfg.56.2020.02.20.14.33.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Feb 2020 14:33:27 -0800 (PST) Received: by mail-lj1-f177.google.com with SMTP id e18so112920ljn.12 for ; Thu, 20 Feb 2020 14:33:26 -0800 (PST) X-Received: by 2002:a2e:97cc:: with SMTP id m12mr19716647ljj.241.1582238006401; Thu, 20 Feb 2020 14:33:26 -0800 (PST) MIME-Version: 1.0 References: <20200210150519.538333-8-gladkov.alexey@gmail.com> <87v9odlxbr.fsf@x220.int.ebiederm.org> <20200212144921.sykucj4mekcziicz@comp-core-i7-2640m-0182e6> <87tv3vkg1a.fsf@x220.int.ebiederm.org> <87v9obipk9.fsf@x220.int.ebiederm.org> <20200212200335.GO23230@ZenIV.linux.org.uk> <20200212203833.GQ23230@ZenIV.linux.org.uk> <20200212204124.GR23230@ZenIV.linux.org.uk> <87lfp7h422.fsf@x220.int.ebiederm.org> <87pnejf6fz.fsf@x220.int.ebiederm.org> <871rqpaswu.fsf_-_@x220.int.ebiederm.org> <87h7zl9e7u.fsf_-_@x220.int.ebiederm.org> In-Reply-To: <87h7zl9e7u.fsf_-_@x220.int.ebiederm.org> From: Linus Torvalds Date: Thu, 20 Feb 2020 14:33:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/7] proc: Mov rcu_read_(lock|unlock) in proc_prune_siblings_dcache To: "Eric W. Biederman" Cc: Al Viro , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov , Solar Designer Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 12:51 PM Eric W. Biederman wrote: > > Don't make it look like rcu_read_lock is held over the entire loop > instead just take the rcu_read_lock over the part of the loop that > matters. This makes the intent of the code a little clearer. No, this is horrid. Maybe it makes the intent clearer, but it also causes that "continue" case to unlock and relock immediately. And maybe that case never triggers, and that's ok. But then it needs a big comment about it. Linus