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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 2AD40C43381 for ; Tue, 19 Feb 2019 05:09:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E66A5217D9 for ; Tue, 19 Feb 2019 05:09:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hl5B+FCQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725786AbfBSFJH (ORCPT ); Tue, 19 Feb 2019 00:09:07 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38577 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfBSFJH (ORCPT ); Tue, 19 Feb 2019 00:09:07 -0500 Received: by mail-pl1-f193.google.com with SMTP id e5so9799490plb.5 for ; Mon, 18 Feb 2019 21:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZIk2S4XciItV3M5rDGT5eMcrU7QD9p11lZTvWdEcT28=; b=Hl5B+FCQ40VTMuJayK8ZPFNFnpVii0r7YXnjcYwlgETYC2ErOKXffKlHBIAwJbtQPi CZeQ+Z+MdWKpsXxeBFox7gpDNNQyWIW8cNMgRVPKYvQqxTi0DMXTLG8E58Hy1QRyUZDr jA4lKO/dMhKrpovsugYNNOtmTB2QdGnPCN/uRbegFRf129H3DqENo9jUtVur9aWRVJAg ufdJc6Bz1UTM6/oRoevLsovoN8L22DZd+kjRIl+cvk3/c7by5VPfAChykEyyt/uAmJ3/ 3qH29AfCNqZqkvkTtraHLITBCVungjVp4ZPQYdE+m1gqxAxaGmshJA9vgzeZRSyQJ/g3 IiCA== 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=ZIk2S4XciItV3M5rDGT5eMcrU7QD9p11lZTvWdEcT28=; b=pe9OvltOZVmQLpOuQTDZmgM1LzdegXdMtLeOyDGGzBn2XnQwpYCKW7bW2ED/FDF3CS RUA1JsYSt9Sgcs9QfrkhIVeMg+bdqbovE1XlshJRxTFQMf2G6WSVgVRDrcsP8Z/qlxI7 5bsoB72B3N+3coe3k9fqc0+CoFgKMdy+ydAaDhRUwiZiIC0Ora02oM2eL5Amf2Qz8TDi LBlMj3vnYv3x1qhLQOf88it78x81kOyl89LVQmVjRx/na7XeFSBax3V6S0nTfjWOeULU /Yn1yKDFYLQlQohq9MFJKm4z34b0BBPcI+qXXm10mNq5Xm+VLKJI38eGxTVlzE5WJ7UW xY8Q== X-Gm-Message-State: AHQUAuZUrftqq7lmwCD78cYclqZLEav8IrIOGL11X3pTI5mMg3oGDTdc xNuaNYSJXfHFYNUwIoK1GfDtxr7dd2fw0c8q2bI= X-Google-Smtp-Source: AHgI3IbT3FgjKiEjtfhBmaIXe8nKhsphFMnFNbj7zkyRc7fGHsaJc/CDRlqo+9PMbZKWDNB31OQuKZKEdhWdvkyJ63I= X-Received: by 2002:a17:902:8203:: with SMTP id x3mr3146431pln.159.1550552946803; Mon, 18 Feb 2019 21:09:06 -0800 (PST) MIME-Version: 1.0 References: <20190211085548.7190-1-vladbu@mellanox.com> <20190211085548.7190-8-vladbu@mellanox.com> <20190214182442.GA19269@splinter> In-Reply-To: From: Cong Wang Date: Mon, 18 Feb 2019 21:08:54 -0800 Message-ID: Subject: Re: [PATCH net-next v4 07/17] net: sched: protect filter_chain list with filter_chain_lock mutex To: Vlad Buslov Cc: Ido Schimmel , "netdev@vger.kernel.org" , "jhs@mojatatu.com" , "jiri@resnulli.us" , "davem@davemloft.net" , "ast@kernel.org" , "daniel@iogearbox.net" Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Feb 15, 2019 at 2:02 AM Vlad Buslov wrote: > > I looked at the code and problem seems to be matchall classifier > specific. My implementation of unlocked cls API assumes that concurrent > insertions are possible and checks for it when deleting "empty" tp. > Since classifiers don't expose number of elements, the only way to test > this is to do tp->walk() on them and assume that walk callback is called > once per filter on every classifier. In your example new tp is created > for second filter, filter insertion fails, number of elements on newly > created tp is checked with tp->walk() before deleting it. However, > matchall classifier always calls the tp->walk() callback once, even when > it doesn't have a valid filter (in this case with NULL filter pointer). Again, this can be eliminated by just switching to normal non-retry logic. This is yet another headache to review this kind of unlock-and-retry logic, I have no idea why you are such a big fan of it.