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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B387BC433DF for ; Fri, 22 May 2020 19:47:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91CA92073B for ; Fri, 22 May 2020 19:47:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R760oobL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730966AbgEVTrY (ORCPT ); Fri, 22 May 2020 15:47:24 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:41067 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730689AbgEVTrY (ORCPT ); Fri, 22 May 2020 15:47:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590176842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YdS6AOeSWK0jUYamTi9EOv+S8oDpX9oHz8NpRLwzlnY=; b=R760oobLu3k/+/nyswzlZNI3In4W8//cIe1tFSTbFhFLDidJXsDP4I/Wifj0lIKRVoeCDT AVKxjRbGjGSaNlMXyWAQABbG3MU2ndB19mXdyfUmYhPVPT6LgtZoQNjyhAXPU/Mo+7lWwn DtxhUXYDRJeyvMHUBa0arXA/nshjmuY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-19-ZIOObcwIP0SER6T9XB6ipQ-1; Fri, 22 May 2020 15:47:18 -0400 X-MC-Unique: ZIOObcwIP0SER6T9XB6ipQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F9C6107ACCA; Fri, 22 May 2020 19:47:17 +0000 (UTC) Received: from [10.10.117.121] (ovpn-117-121.rdu2.redhat.com [10.10.117.121]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CA3160E1C; Fri, 22 May 2020 19:47:16 +0000 (UTC) Subject: Re: [PATCH net] tipc: block BH before using dst_cache To: Eric Dumazet , Xin Long , Eric Dumazet Cc: "David S . Miller" , netdev , syzbot , tipc-discussion@lists.sourceforge.net References: <20200521182958.163436-1-edumazet@google.com> <76d02a44-91dd-ded6-c3dc-f86685ae1436@redhat.com> <217375c0-d49d-63b1-0628-9aaf7e4e42d0@gmail.com> From: Jon Maloy Message-ID: Date: Fri, 22 May 2020 15:47:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <217375c0-d49d-63b1-0628-9aaf7e4e42d0@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 5/22/20 11:57 AM, Eric Dumazet wrote: > > On 5/22/20 8:01 AM, Jon Maloy wrote: >> >> On 5/22/20 2:18 AM, Xin Long wrote: >>> On Fri, May 22, 2020 at 1:55 PM Eric Dumazet wrote: >>>> Resend to the list in non HTML form >>>> >>>> >>>> On Thu, May 21, 2020 at 10:53 PM Eric Dumazet wrote: >>>>> >>>>> On Thu, May 21, 2020 at 10:50 PM Xin Long wrote: >>>>>> On Fri, May 22, 2020 at 2:30 AM Eric Dumazet wrote: >>>>>>> dst_cache_get() documents it must be used with BH disabled. >>>>>> Interesting, I thought under rcu_read_lock() is enough, which calls >>>>>> preempt_disable(). >>>>> rcu_read_lock() does not disable BH, never. >>>>> >>>>> And rcu_read_lock() does not necessarily disable preemption. >>> Then I need to think again if it's really worth using dst_cache here. >>> >>> Also add tipc-discussion and Jon to CC list. >> The suggested solution will affect all bearers, not only UDP, so it is not a good. >> Is there anything preventing us from disabling preemtion inside the scope of the rcu lock? >> >> ///jon >> > BH is disabled any way few nano seconds later, disabling it a bit earlier wont make any difference. The point is that if we only disable inside tipc_udp_xmit() (the function pointer call) the change will only affect the UDP bearer, where dst_cache is used. The corresponding calls for the Ethernet and Infiniband bearers don't use dst_cache, and don't need this disabling. So it does makes a difference. ///jon > > Also, if you intend to make dst_cache BH reentrant, you will have to make that for net-next, not net tree. > > Please carefully read include/net/dst_cache.h > > It is very clear about BH requirements. > >