Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp38754pxf; Wed, 24 Mar 2021 20:14:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyCB/McQ6vE3Fg5Ik0B33pNWUCJ+bbFrLKdGSCpb9G/kAex7vgzfa3np8j5I9OgmkY3rpm X-Received: by 2002:a17:906:d94:: with SMTP id m20mr6814509eji.511.1616642084218; Wed, 24 Mar 2021 20:14:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616642084; cv=none; d=google.com; s=arc-20160816; b=DUwG874pWD9Yr7M8sP67LJdU6hzsGVPqgGFpyT/gHkB0FU3Pbpaesee4FoN6lfBE8A gJjVYVG2w0OTxVMGFx6g/Hve1bIU3d3McHekCTmvFACwEOgof7+2itRMVvgIF88HyD4n uOe9OXqMjyoT2TY6jwfcL8QlnEYGY/jI45bhJoPijZwfIcDayw5QfJJciFsRQcwJFZnt Z7FB17mS2ueiW1mU7QBdN1iOk25t5266rrHPLa2ZE1bmZxsZBmle3mmhuo5U1Z5UlyuN 2wZuGzMRu3v1zU7JnGaza5eG2mGh5UWz6C76f/iULnFrZR097qEkJd9hyKuSQ1Yp/vbo 2Sxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9NHvGbYgx7b1RA6FmsOP8tSsmUCY02pADy0trvYTHY0=; b=0ogIO1quxa5gQWMG7azlhiLsfF0xgxCzjG8jc8VuYCGqv6X6HEcfhgxNoPq+MOvJcu l0FyME4fdSJScZovGpkfqBQz2sDW2LmjNJqetkn9GMAar4b/tjVjhuNepIGJ9Xx25ZIF EEe1HBbLqTfxVQ95ONoRh4ryX7SYN0GSYeNv5hWs0ewgo7D7PXLamzMxQARnIBreUwGr SoGMEU8rkV6Mr/Vryl50eAQekcfZXL3WHeAw79UVtlcWafr9csLSXdlXpPju1LaJR+2z LTQWLvmSst+UGhwU/DPjpj9nLjL10AZjNIIjlfiXMChHo/x0FGCb+L53TCbIpfGl3yFU J4ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Ni17SpFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kk22si3252907ejc.98.2021.03.24.20.14.22; Wed, 24 Mar 2021 20:14:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Ni17SpFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236622AbhCXP3V (ORCPT + 99 others); Wed, 24 Mar 2021 11:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236571AbhCXP2s (ORCPT ); Wed, 24 Mar 2021 11:28:48 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFAEC061763 for ; Wed, 24 Mar 2021 08:28:47 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id 124so11548890vsg.12 for ; Wed, 24 Mar 2021 08:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9NHvGbYgx7b1RA6FmsOP8tSsmUCY02pADy0trvYTHY0=; b=Ni17SpFn+MHIRNHkQruS/T4D01kccEYuS1VGVWvhUFGIxPF6cNunGVKej99/TTv66N rRd+2IuFUYYcFogK6OpwCrATkxASKiQuF9SdJFvNj0g4bxP/xo8MHb+Qe9m9yzSWzHIO 6uc060B+dkyTBVeT9pRvxFq54f7Y/id0AzsOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9NHvGbYgx7b1RA6FmsOP8tSsmUCY02pADy0trvYTHY0=; b=RmIod9O8IxBY7fDDYbcUByf6ytUw9dd1zeo7t16IMfuBAYGm7k0hE3gHj+12jE6eOc lo70EhVjR4xTCE4h5qv9aBLzmGHE2qjPN60JGPOWhKlTQWcG5ix3Y8PMJQL7d8KvEPN3 5Lohi3Qf7DJlGYcA9LIuaO00TZpxNHUQtgVjuBTeGPM4LEc5D5a9LzpY0GQQmd275qVB bHv1A4D4c+8KBqMQiX0JK3wmDzpBgYBOso+0t5D95jKl3bm25EHmDoHhE/5wDW4dIkPF I/YttRjfPWPewltZJLhC/09zwTiUa+BRZakeCcjXLTHrLy/nK3/jj3865fzdfldTSesh WGmA== X-Gm-Message-State: AOAM531bvi5211+LAtF6ascU25uv/yceoTRScGzbbbYtzhqCBlB/5zns 1H0efHtCEw3Vcq3uinHwogPwlJvYv1RpvpDENEflvw== X-Received: by 2002:a67:8793:: with SMTP id j141mr2327094vsd.7.1616599726875; Wed, 24 Mar 2021 08:28:46 -0700 (PDT) MIME-Version: 1.0 References: <20210202040830.26043-1-huangjianan@oppo.com> In-Reply-To: <20210202040830.26043-1-huangjianan@oppo.com> From: Miklos Szeredi Date: Wed, 24 Mar 2021 16:28:35 +0100 Message-ID: Subject: Re: [fuse-devel] [PATCH] fuse: avoid deadlock when write fuse inode To: Huang Jianan Cc: linux-kernel@vger.kernel.org, guoweichao@oppo.com, zhangshiming@oppo.com, linux-fsdevel@vger.kernel.org, linux-mm , =?UTF-8?B?RWQgVHNhaSAo6JSh5a6X6LuSKQ==?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 2, 2021 at 5:41 AM Huang Jianan via fuse-devel wrote: > > We found the following deadlock situations in low memory scenarios: > Thread A Thread B > - __writeback_single_inode > - fuse_write_inode > - fuse_simple_request > - __fuse_request_send > - request_wait_answer > - fuse_dev_splice_read > - fuse_copy_fill > - __alloc_pages_direct_reclaim > - do_shrink_slab > - super_cache_scan > - shrink_dentry_list > - dentry_unlink_inode > - iput_final > - inode_wait_for_writeback On what kernel are you seeing this? I don't see how it can happen on upstream kernels, since there's a "write_inode_now(inode, 1)" call in fuse_release() and nothing can dirty the inode after the file has been released. Thanks, Miklos