Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1621842imw; Sat, 9 Jul 2022 08:08:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uvun6ft+l/lNSDVVrbIf4ehFHXKXsFKzFwG2bWy2WKkd7zexpnWBv6sXl79ArL1o2kQhhr X-Received: by 2002:a17:907:6d1f:b0:726:abaf:1765 with SMTP id sa31-20020a1709076d1f00b00726abaf1765mr9337379ejc.126.1657379304250; Sat, 09 Jul 2022 08:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657379304; cv=none; d=google.com; s=arc-20160816; b=LNDdKo9530BZaGgLOR7VerVSzNaNgo32HMlRvIQEsUx4R2ap9Z9nZXLzoE9P0AZDgk H0/+m8iK9r6kIEjUwEOntl4zETCJf+08Pmx7ZosE2IQbPys9hepxz1qInh6JaF8L+rHA b6GkTYBRdRvlUZS5bap/MBzMpvw23HCe/fTpJBIKGwx9giwRsZa8ebeABvMqDe2jIJCe K3H8z1BnyS6mpKRT3FvVRkWstwk/Iglnvlnqo3hwsFYfRgdUctmHtBAtTIMPs0oSQu7h GEry4jalf2uCN0xjrMZVF/sLjCPdiXw/uvmYw9sbyupHSharY1+3ClgGf1nkWPRvpq69 +dIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=Aw3ipmbfX7HeLppcMOKDUFXLlpt4/DN5yWy0NUdSWr8=; b=WFf2wD9+jJ7Y4vxRtHHdZ/sL9tBme9bDgBLisPBhGbGCxJypy7Tt1QlSjqyUlWWIAA CVoC28GdNtTJdwV2RPQiXZRJTOMm0wUqdJWrThU+d+xOQIdZjQjs+T8OVfSUVGjaZfjs luaa0rkwv8OriRTJ0hZ2mxXU555yMbJ9JX69HprtVuWa44kfIzB8uiMryCr3lVgFcexv xhzSDyqYQgy8d3151dnE5kWoDAZsuIN2ogVrSWuDMOUuBFHPm1mZ9hNEt7cDwWqI8331 04t7qf3GNHlUn7CgMwe4QeF4b5n/C69tczAlEbMa5NbFOoW9cEj/rV32EwNeFZ5tF0H8 8EvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=V19aw6m+; dkim=pass header.i=@codewreck.org header.s=2 header.b=V19aw6m+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a056402358e00b004359f471717si3046196edc.0.2022.07.09.08.07.50; Sat, 09 Jul 2022 08:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=V19aw6m+; dkim=pass header.i=@codewreck.org header.s=2 header.b=V19aw6m+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbiGIOnU (ORCPT + 99 others); Sat, 9 Jul 2022 10:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbiGIOnS (ORCPT ); Sat, 9 Jul 2022 10:43:18 -0400 Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D2921F624 for ; Sat, 9 Jul 2022 07:43:15 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id D3A42C009; Sat, 9 Jul 2022 16:43:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1657377793; bh=Aw3ipmbfX7HeLppcMOKDUFXLlpt4/DN5yWy0NUdSWr8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V19aw6m+IhT5CXd4C2FkkNHbsOLZE6eTdbj6/oqtQLlJ34AWsr25i1NA86VGcOTxN k5zlJCtWOa9FlFPQuyCWd6ureanl/m0kRr/b/02uKaAyAZ1EL0Me4zwvqVRrMfgkRv ppgz+z5gY3vS21TH3mQuyHPC16SCpHoNzr8GiVDLnCZImGdcPJc2PS1lig+ozkyCEi CHNkFysRZoKhdN0R4T+pE67KUOdMIQFeBucfEV8N7rFnlyIC2GsjuejZZAEEf8W8x6 n6SMZkZ6849+5wJoY7LDaiXRnjy0DfhNrG/RgxZcSDr2nJeP4Zjo1SMnIP12PL7J8Z SrUYn9T5LJt5Q== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 5396BC009; Sat, 9 Jul 2022 16:43:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1657377793; bh=Aw3ipmbfX7HeLppcMOKDUFXLlpt4/DN5yWy0NUdSWr8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V19aw6m+IhT5CXd4C2FkkNHbsOLZE6eTdbj6/oqtQLlJ34AWsr25i1NA86VGcOTxN k5zlJCtWOa9FlFPQuyCWd6ureanl/m0kRr/b/02uKaAyAZ1EL0Me4zwvqVRrMfgkRv ppgz+z5gY3vS21TH3mQuyHPC16SCpHoNzr8GiVDLnCZImGdcPJc2PS1lig+ozkyCEi CHNkFysRZoKhdN0R4T+pE67KUOdMIQFeBucfEV8N7rFnlyIC2GsjuejZZAEEf8W8x6 n6SMZkZ6849+5wJoY7LDaiXRnjy0DfhNrG/RgxZcSDr2nJeP4Zjo1SMnIP12PL7J8Z SrUYn9T5LJt5Q== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id bf5b7337; Sat, 9 Jul 2022 14:43:08 +0000 (UTC) Date: Sat, 9 Jul 2022 23:42:53 +0900 From: Dominique Martinet To: Christian Schoenebeck Cc: Kent Overstreet , linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, Eric Van Hensbergen , Latchesar Ionkov Subject: Re: [PATCH 3/3] 9p: Add mempools for RPCs Message-ID: References: <20220704010945.C230AC341C7@smtp.kernel.org> <72042449.h6Bkk5LDil@silver> <1690934.P4sCSNuWZQ@silver> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1690934.P4sCSNuWZQ@silver> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christian Schoenebeck wrote on Sat, Jul 09, 2022 at 04:21:46PM +0200: > > The best thing to do would probably to just tell the client it can't use > > the mempools for flushes -- the flushes are rare and will use small > > buffers with your smaller allocations patch; I bet I wouldn't be able to > > reproduce that anymore but it should probably just forbid the mempool > > just in case. > > So the problem is that one task ends up with more than 1 request at a time, > and the buffer is allocated and associated per request, not per task. If I am > not missing something, then this scenario (>1 request simultaniously per task) > currently may actually only happen with p9_client_flush() calls. Which > simplifies the problem. Yes that should be the only case where this happens. > So probably the best way would be to simply flip the call order such that > p9_tag_remove() is called before p9_client_flush(), similar to how it's > already done with p9_client_clunk() calls? I don't think we can do that safely without some extra work - because until we get the reply from the flush, the legitimate reply to the original request can still come. It's perfectly possible that by the time we sent the flush the server will have sent the normal reply to our original request -- actually with flush stuck there it's actually almost certain it has... For trans fd for example the reads happen in a worker thread, if that buffer disappears too early it'll fail with EIO and the whole mount will break down as I think that'll just kill the read worker... (actually how does that even work, it checks for rreq->status != REQ_STATUS_SENT but it should be FLSHD at this point .... erm) In theory we can probably adjust the cancel() callback to make sure that we never use the recv/send buffers from there on but it might be tricky, still for tcp that's this 'm->rc.sdata' that will be read into and can point to a recv buffer if we're mid-reading (e.g. got header for that reply but it wasn't done in a single read() call and waiting for more data); and that operatres without the client lock so we can't just take it away easily... Well, that'll need careful considerations... I think it'll be much simpler to say flush calls are allocated weird and don't use the mempool, even if it's another bit of legacy that'll be hard to understand why we did that down the road... > > Anyway, I'm not comfortable with this patch right now, a hang is worse > > than an allocation failure warning. > > As you already mentioned, with the pending 'net/9p: allocate appropriate > reduced message buffers' patch those hangs should not happen, as Tflush would > then just kmalloc() a small buffer. But I would probably still fix this issue > here nevertheless, as it might hurt in other ways in future. Shouldn't be too > much noise to swap the call order, right? I definitely want to fix this even with your patches, yes. -- Dominique