From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH bpf 4/4] xsk: fix potential race in SKB TX completion code Date: Wed, 27 Jun 2018 08:55:06 -0700 Message-ID: <54fa1b60-ebae-94a2-8036-06df6c05307a@gmail.com> References: <1530108136-4984-1-git-send-email-magnus.karlsson@intel.com> <1530108136-4984-5-git-send-email-magnus.karlsson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: qi.z.zhang@intel.com, pavel@fastnetmon.com To: Magnus Karlsson , bjorn.topel@intel.com, ast@fb.com, daniel@iogearbox.net, netdev@vger.kernel.org Return-path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:42944 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbeF0PzI (ORCPT ); Wed, 27 Jun 2018 11:55:08 -0400 Received: by mail-pl0-f67.google.com with SMTP id w17-v6so1238421pll.9 for ; Wed, 27 Jun 2018 08:55:08 -0700 (PDT) In-Reply-To: <1530108136-4984-5-git-send-email-magnus.karlsson@intel.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 06/27/2018 07:02 AM, Magnus Karlsson wrote: > There was a potential race in the TX completion code for > the SKB case when the TX napi thread and the error path > of the sendmsg code could both call the SKB destructor > at the same time. Fixed by introducing a spin_lock in the > destructor. Wow, what is the impact on performance ? Please describe a bit more what is the problem.