Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp419808imw; Wed, 13 Jul 2022 00:23:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vZtlJTKvRNRZ+9CTgK0FQsTOZzXiaI/tdfyFtRjjY/QacjgLqU40aF32M0+mcSv608s041 X-Received: by 2002:a17:90b:164a:b0:1ef:e6ae:4b56 with SMTP id il10-20020a17090b164a00b001efe6ae4b56mr8651337pjb.5.1657696993146; Wed, 13 Jul 2022 00:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657696993; cv=none; d=google.com; s=arc-20160816; b=MrrCXpDhXShQAQKNcVYqTM1O9KG+WID1LkOyKME7juJQyH5Q+jdgpG86yD3h15YDG5 nmGbz5kiLj6ZMpOacFhXjnsLfxvZGmlIPA7dj4RsWFRMJiwoxJQuTg+0qjg7GNwpkbbr xJPk0Y7YlbQVXAZ+of3NdKuuMIZDjS93gEF49mVeEylzN9MpfLEXYw1fzNoIDKN1DAXf zFRq4hZejTK87+p8LsyJrZKjifx64FfF0kahQ1LU2+HTdfqLz7tP/invjCay70cQ1aNJ IflGjtgiL5Fgv0HdmwORR9dzTog0qWVV929sFPYRNgvRMOM/bAYuABlvw5R/Yg1hSQsl 4nJQ== 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=c5Xq6MAbIOWGs66QYYBt/zBq3dTbFAGujt8LMl/IQ+0=; b=xNntqGLE6ocV20nbIdZrTz5nKrjHTnT686W4ntisGhxYDKr/ETzGDO9/4Je0IPXQzi 8eEp/YY+5u2owe3fimYm1xlPBybG2INi4WQEJcXX4seqfUgMCrcjQIGfLgojU4yRdQoD p8vaYgx0UH1XDoGfsIYADGt8TVOjnCxroMeDfxRzW1Xua0cYrjcZt3OPTYdzyNEeG0Ke vkX7JFT8Xa858/Dm0SEIxq1bl0fu0S4thhIkUxhpTHhMFNv9wm7xIQzvGLrt639xMEv0 uFJzer0TkfQTc0eRkJXmgJJot58eCfpqKIrTOTj1puKvtHcvwswbC0I4K2w3EXk4BvL0 RUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=ylDrCMaX; dkim=pass header.i=@codewreck.org header.s=2 header.b=ylDrCMaX; 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 j63-20020a638042000000b00419699fdc27si4289483pgd.709.2022.07.13.00.22.47; Wed, 13 Jul 2022 00:23:13 -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=ylDrCMaX; dkim=pass header.i=@codewreck.org header.s=2 header.b=ylDrCMaX; 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 S234611AbiGMHMc (ORCPT + 99 others); Wed, 13 Jul 2022 03:12:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231352AbiGMHMb (ORCPT ); Wed, 13 Jul 2022 03:12:31 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CB9BEA9 for ; Wed, 13 Jul 2022 00:12:29 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id D5617C01F; Wed, 13 Jul 2022 09:12:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1657696347; bh=c5Xq6MAbIOWGs66QYYBt/zBq3dTbFAGujt8LMl/IQ+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ylDrCMaXjdknDbl8tiJxwUWGLbHD9Y+QgMYZTO8qqA42RDSO/LfEANT6k5Or1ySLg +kqWTV4Wo8HHjErYfWBcUj6QyHVKnSHOThUOOyIDf2t1LZRkHpgulmsq5pA1Ztjkdw hVv+KhbtwQIKMfuD9iiw3vWDg5aaytjAaY69o1qZ6qu/mpQQywDiKjCMPYsNm6I1Qj 2HjpVGDRGeLB5h42XeEjuUUH8ixPofN7lvMjDaHnYh0r6xuZjnVAL0rriuDCKZLfby zrQnNrKEqeZhVv3NMLns2EqnJU8n7CPUcBpMk+aQCavUJ+V69oeW1JDK11F6359mp/ mfY62ysGnCOaQ== 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 DE484C009; Wed, 13 Jul 2022 09:12:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1657696347; bh=c5Xq6MAbIOWGs66QYYBt/zBq3dTbFAGujt8LMl/IQ+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ylDrCMaXjdknDbl8tiJxwUWGLbHD9Y+QgMYZTO8qqA42RDSO/LfEANT6k5Or1ySLg +kqWTV4Wo8HHjErYfWBcUj6QyHVKnSHOThUOOyIDf2t1LZRkHpgulmsq5pA1Ztjkdw hVv+KhbtwQIKMfuD9iiw3vWDg5aaytjAaY69o1qZ6qu/mpQQywDiKjCMPYsNm6I1Qj 2HjpVGDRGeLB5h42XeEjuUUH8ixPofN7lvMjDaHnYh0r6xuZjnVAL0rriuDCKZLfby zrQnNrKEqeZhVv3NMLns2EqnJU8n7CPUcBpMk+aQCavUJ+V69oeW1JDK11F6359mp/ mfY62ysGnCOaQ== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id 75c57f87; Wed, 13 Jul 2022 07:12:20 +0000 (UTC) Date: Wed, 13 Jul 2022 16:12:05 +0900 From: Dominique Martinet To: Kent Overstreet Cc: Christian Schoenebeck , linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, Greg Kurz , Eric Van Hensbergen , Latchesar Ionkov Subject: Re: [RFC PATCH] 9p: forbid use of mempool for TFLUSH Message-ID: References: <12950409.o0bIpVV1Ut@silver> <20220713041700.2502404-1-asmadeus@codewreck.org> <0aa8323d-9461-a861-ac35-6952e7aeaf93@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0aa8323d-9461-a861-ac35-6952e7aeaf93@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kent Overstreet wrote on Wed, Jul 13, 2022 at 02:39:06AM -0400: > On 7/13/22 00:17, Dominique Martinet wrote: > > TFLUSH is called while the thread still holds memory for the > > request we're trying to flush, so mempool alloc can deadlock > > there. With p9_msg_buf_size() rework the flush allocation is > > small so just make it fail if allocation failed; all that does > > is potentially leak the request we're flushing until its reply > > finally does come.. or if it never does until umount. > > Why not just add separate mempools for flushes? We don't have to allocate > memory for big payloads so they won't cost much, and then the IO paths will > be fully mempool-ified :) I don't think it really matters either way -- I'm much more worried about the two points I gave in the commit comment section: mempools not being shared leading to increased memory usage when many mostly-idle mounts (I know users who need that), and more importantly that the mempool waiting is uninterruptible/non-failible might be "nice" from the using mempool side but I'd really prefer users to be able to ^C out of a mount made on a bad server getting stuck in mempool_alloc at least. It looked good before I realized all the ways this could hang, but now I just think for something like 9p it makes more sense to fail the allocation and the IO than to bounce forever trying to allocate memory we don't have. Let's first see if you still see if you still see high order allocation failures when these are made much less likely with Chritisan's patch. What I intend to push this cycle is in https://github.com/martinetd/linux/commits/9p-test up to 'net/9p: allocate appropriate reduced message buffers'; if you can easily produce them I'd appreciate if you could confirm if it helps. (just waiting for Chritian's confirmation + adjusting the strcmp for rdma before I push it to 9p-next) -- Dominique