Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp493imm; Fri, 25 May 2018 14:41:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrDaKUwbXrPKaCSlgFRkUCywjO/dQ8tBMOsaIlFkzp+ukxhyXio4gjSc4VaslIGXZ0OfzVh X-Received: by 2002:a17:902:b60b:: with SMTP id b11-v6mr4291577pls.330.1527284473484; Fri, 25 May 2018 14:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527284473; cv=none; d=google.com; s=arc-20160816; b=oWm2wtWZRX/QY4eE4cAc1kXQg/e7jOqwGlCMU4gNc1eldLcOs2EcgzJ43mDSfNUtDB CLEt3FLeUyh5i3wdvQhUHilQDZJ18GL5Ls7aoCDf+jvB7O2x0QbtIIsHvOuzk/EoQ1S2 XylU7ixp+GP60lMDf4WQgaph6TKzMDpV16Hu+WK+RulvGXvMZ+hs9iXm+nwZ6tFuqABR KK2dkAmIH7GNm3R6D8VNF95iusR/EwsrskyHam1GaOVWeY5PjhbmnAEVDpIzxoeCJJcd C5Wzk2IYA4McFQPdn6/dmpZWh+uBf/zD+1AojPmjbxwmiosSRuUjicUZKaq/A0eFiw5l zFFg== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ol+imUsaJHOmiIFwr1vtsYU8uP/gc17ELhRMII0kuV8=; b=or0eKqykNWAiDn8sisX8HkXCQ1Bx8hh8hyya2T7xepjQy4Lzk28ldP1tP4RLLeTvMe YjvFdGismtKyFigWCSCnSEjvOFdEbVQWdAyYN18bvsgdq3Jvn52w7sqEHsKGTfoB97Ms 5Mt29c7901zqO9l4cBjTJ7gTeJvPW4BTMhUgP5UaZcRuYrT3TlMVm9P7euTaJlM1odBC jD5EQPoIUtetbffD3frEqEmfPMqhxp/7PPZMZGiWgcHMRGqIa4SWRNNnOJ0vt8K5gTA+ qiO9X6ly5RkyzhA/cd7fekSvFHXAXyhvylvIK87Z3p7N+fOpaY/OcyBfxqskveLj52Ws FbYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZNhNfgJC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si24269114plv.16.2018.05.25.14.40.58; Fri, 25 May 2018 14:41:13 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=ZNhNfgJC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030477AbeEYVks (ORCPT + 99 others); Fri, 25 May 2018 17:40:48 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34491 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030314AbeEYVkp (ORCPT ); Fri, 25 May 2018 17:40:45 -0400 Received: by mail-pf0-f194.google.com with SMTP id a14-v6so3158893pfi.1; Fri, 25 May 2018 14:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ol+imUsaJHOmiIFwr1vtsYU8uP/gc17ELhRMII0kuV8=; b=ZNhNfgJCZ1xb84s3SEcCxi5dKWtFXZML6A2/CnXrVRtxmvfbOWfc8zZLxOT+UMak86 uKhpTL60BiZoeag/gW64e1C8qUHwFoRXpjqRLHUEsBH+4xwj0lNE4LIj8shhD6DSvdGc fiuG7cGJoju7TtYAMKD/Sfi1EyAoYcmt6YsNz5naiUynFj/vOljE37f+6HsQXk9x/uhh Qno0Q8VUyOyRvkggsO1DqZcxqpTejaFVG2wZ8pL+hZc6Km8YXcJnpkFKRprmj/EMYbHm EqCF2u8JB+RoiQRhLkJyEsCFnNowD2uvbFj8wsbUJCuS5Ft++EL7f4NAsqktnKtXN1ii hafw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ol+imUsaJHOmiIFwr1vtsYU8uP/gc17ELhRMII0kuV8=; b=f5wvgEhQZuA1DhpC8kLQ+IGcRcYdprd0EIrQGrmAtAx/Nvj7TiSeh6KCj1VvVMKPxd U3cDtCYvn47c63A+3kLflyryIbQhQAoya80Q2A7T5YBnWJn2tSiYH4TQmgA2S3Ga9ADX nrV7/f4Xf4zHxavz+fDiA7VBSf4g64gcSE+oSsvywT6aWcehQuzv9dWvBynKzZ5E8sf1 Y82XRvuv+gO/8VP9Anr7P3FkUbN2qSgvrAAY3esYb4Z6HK6oVGRJgVuHbDhjk0gskky/ Y/zlGtJb84FR9X8aJqKNi0QR30qBQnZJwx0zQ8uIeUSXe6FDBeWy3WEVuTx45krTp+XJ FDXw== X-Gm-Message-State: ALKqPwd1DzJbErokkFfOE0f6UGI51R6Dqeuj500MEZaBIh2xC40G87du lpzeAmoR0rmPNmx55nic+Y+tSeZj+I1VAvBfmZk= X-Received: by 2002:a65:5206:: with SMTP id o6-v6mr3283258pgp.157.1527284444768; Fri, 25 May 2018 14:40:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:b398:0:0:0:0 with HTTP; Fri, 25 May 2018 14:40:24 -0700 (PDT) In-Reply-To: References: <1526308035-12484-1-git-send-email-vladbu@mellanox.com> From: Cong Wang Date: Fri, 25 May 2018 14:40:24 -0700 Message-ID: Subject: Re: [PATCH 00/14] Modify action API for implementing lockless actions To: Vlad Buslov Cc: Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , Jiri Pirko , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Alexei Starovoitov , Daniel Borkmann , Eric Dumazet , Kees Cook , LKML , NetFilter , coreteam@netfilter.org, kliteyn@mellanox.com 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 Fri, May 25, 2018 at 1:39 PM, Vlad Buslov wrote: > > On Thu 24 May 2018 at 23:34, Cong Wang wrote: >> On Mon, May 14, 2018 at 7:27 AM, Vlad Buslov wrote: >>> Currently, all netlink protocol handlers for updating rules, actions and >>> qdiscs are protected with single global rtnl lock which removes any >>> possibility for parallelism. This patch set is a first step to remove >>> rtnl lock dependency from TC rules update path. It updates act API to >>> use atomic operations, rcu and spinlocks for fine-grained locking. It >>> also extend API with functions that are needed to update existing >>> actions for parallel execution. >> >> Can you give a summary here for what and how it is achieved? > > Got it, will expand cover letter in V2 with summary. >> >> You said this is the first step, what do you want to achieve in this >> very first step? And how do you achieve it? Do you break the RTNL > > But aren't this questions answered in paragraph you quoted? Obviously not, you said to remove it, but never explains why it can be removed and how it is removed. This is crucial for review. "use atomic operations, rcu and spinlocks for fine-grained locking" is literately nothing, why atomic/rcu makes RTNL unnecessary? How RCU is used? What spinlocks are you talking about? What do these spinlocks protect after removing RTNL? Why are they safe with other netdevice and netns operations? You explain _nothing_ here. Really. Please don't force people to read 14 patches to understand how it works. In fact, no one wants to read the code unless there is some high-level explanation that makes basic sense. > What: Change act API to not rely on one-big-global-RTNL-lock and to use > more fine-grained synchronization methods to allow safe concurrent > execution. Sure, how fine-grained it is after your patchset? Why this fine-grained lock could safely replace RTNL? Could you stop letting us guess your puzzle words? It would save your time from exchanging emails with me, it would save my time from guessing you too. It is a win-win. > How: Refactor act API code to use atomics, rcu and spinlocks, etc. for > protecting shared data structures, add new functions required to update What shared data structures? The per-netns idr which is already protected by a spinlock? The TC hierarchy? The shared standalone actions? Hey, why do I have to guess? :-/ > specific actions implementation for parallel execution. (step 2) Claim is easy, prove is hard. I can easily claim I break RTNL down to a per-netns lock, but I can't prove it really works. :-D > > If you feel that this cover letter is too terse, I will add outline of > changes in V2. It is not my rule, it is how you have to help people to review your 14 patches. I think it is a fair game: you help people like me to review your patches, we help you to get them reviewed and merged if they all make sense. > >> lock down to, for a quick example, a per-device lock? Or perhaps you >> completely remove it because of what reason? > > I want to remove RTNL _dependency_ from act API data structures and > code. I probably should me more specific in this case: > > Florian recently made a change that allows registering netlink protocol > handlers with flag RTNL_FLAG_DOIT_UNLOCKED. Handlers registered with > this flag are called without RTNL taken. My end goal is to have rule > update handlers(RTM_NEWTFILTER, RTM_DELTFILTER, etc.) to be registered > with UNLOCKED flag to allow parallel execution. Please add this paragraph in your cover letter, it is very important for review. > > I do not intend to globally remove or break RTNL. > >> >> I go through all the descriptions of your 14 patches (but not any code), >> I still have no clue how you successfully avoid RTNL. Please don't >> let me read into your code to understand that, there must be some >> high-level justification on how it works. Without it, I don't event want >> to read into the code. > > On internal code review I've been asked not to duplicate info from > commit messages in cover letter, but I guess I can expand it with some > high level outline in V2. In cover letter, you should put a high-level overview of "why" and "how". If, in the worst case, on high-level it doesn't make sense, why should we bother to read the code? In short, you have to convince people to read your code here. In each patch description, you should explain what a single patch does. I don't see any duplication.