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.3 required=3.0 tests=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 03F03C47404 for ; Fri, 11 Oct 2019 11:04:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9121206CD for ; Fri, 11 Oct 2019 11:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727653AbfJKLEq (ORCPT ); Fri, 11 Oct 2019 07:04:46 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]:38610 "EHLO os.inf.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727592AbfJKLEq (ORCPT ); Fri, 11 Oct 2019 07:04:46 -0400 X-Greylist: delayed 1372 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Oct 2019 07:04:45 EDT Received: from [141.76.29.166] (helo=[172.26.144.86]) by os.inf.tu-dresden.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) id 1iIsMq-0005eE-L3; Fri, 11 Oct 2019 12:41:52 +0200 Subject: Re: [PATCH 10/10] Replace tasklets with workqueues From: Maksym Planeta To: Jason Gunthorpe Cc: Moni Shoua , Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190722151426.5266-1-mplaneta@os.inf.tu-dresden.de> <20190722151426.5266-11-mplaneta@os.inf.tu-dresden.de> <20190722153205.GG7607@ziepe.ca> <21a4daf9-c77e-ec80-9da0-78ab512d248d@os.inf.tu-dresden.de> <20190725185006.GD7467@ziepe.ca> <385139f2-0d31-1148-95c0-a6e6768ab413@os.inf.tu-dresden.de> Message-ID: <995754de-5ec4-0a62-991e-2ea77a6bc622@os.inf.tu-dresden.de> Date: Fri, 11 Oct 2019 12:41:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <385139f2-0d31-1148-95c0-a6e6768ab413@os.inf.tu-dresden.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Hi, this is a kind reminder regarding the patchset. I added description of races in the original email. On 30/07/2019 21:20, Maksym Planeta wrote: > > > On 25/07/2019 20:50, Jason Gunthorpe wrote: >> On Thu, Jul 25, 2019 at 04:36:20PM +0200, Maksym Planeta wrote: >>> Is this one better? >>> >>> Replace tasklets with workqueues in rxe driver. The reason for this >>> replacement is that tasklets are supposed to run atomically, although >>> the >>> actual code may block. >>> >>> Modify the SKB destructor for outgoing SKB's to schedule QP tasks >>> only if >>> the QP is not destroyed itself. >>> >>> Add a variable "pending_skb_down" to ensure that reference counting >>> for a QP >>> is decremented only when QP access related to this skb is over. >>> >>> Separate part of pool element cleanup code to allow this code to be >>> called >>> in the very end of cleanup, even if some of cleanup is scheduled for >>> asynchronous execution. Example, when it was happening is destructor >>> for a >>> QP. >>> >>> Disallow calling of task functions "directly". This allows to >>> simplify logic >>> inside rxe_task.c >>> >>> Schedule rxe_qp_do_cleanup onto high-priority system workqueue, >>> because this >>> function can be scheduled from normal system workqueue. >>> >>> Before destroying a QP, wait until all references to this QP are gone. >>> Previously the problem was that outgoing SKBs could be freed after >>> the QP >>> these SKBs refer to is destroyed. >>> >>> Add blocking rxe_run_task to replace __rxe_do_task that was calling task >>> function directly. >> >> Mostly but it would also be good to describe the use after free and >> races more specifically >> > > These situations are described in the cover letter (PATCH 00/10). Do you > need a more detailed description than that? > >> Jason >> > -- Regards, Maksym Planeta