Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbdG1HpM (ORCPT ); Fri, 28 Jul 2017 03:45:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:35722 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751045AbdG1HpL (ORCPT ); Fri, 28 Jul 2017 03:45:11 -0400 Date: Fri, 28 Jul 2017 09:45:09 +0200 From: Jan Kara To: Gu Zheng Cc: eparis@redhat.com, viro@zeniv.linux.org.uk, Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "miaoxie@huawei.com" Subject: Re: Fwd: trinity test fanotify cause hungtasks on kernel 4.13 Message-ID: <20170728074509.GA29433@quack2.suse.cz> References: <5979B8A5.205@huawei.com> <597AB4ED.9090306@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <597AB4ED.9090306@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1281 Lines: 40 On Fri 28-07-17 11:52:13, Gu Zheng wrote: > > hi,ALL: > when we used the trinity test the fanotify interfaces, it cause many hungtasks. > CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y > the shell is simple: > 1 #!/bin/bash > 2 > 3 while true > 4 do > 5 ./trinity -c fanotify_init -l off -C 2 -X > /dev/null 2>&1 & > 6 sleep 1 > 7 ./trinity -c fanotify_mark -l off -C 2 -X > /dev/null 2>&1 & > 8 sleep 10 > 9 done > we found the trinity enter the D state fastly. > we check the pids'stack > all progresses are waiting for the response in fanotify_handle_event->fanotify_get_response, > becauseof non-response or killed monitor,so the waitqueue is in blocked state, > then the others will be stucked which use the fanotify_get_response. Yes, this all works as expected. > if we use wait_event_timeout , the responed time can not be guaranteed. > > do you have any ideas? So if your target is sensible trinity testing of fanotify, what you could do is that you would gather all descriptors where fanotify_init() succeeded, watch them and reply to all fanotify events. Alternatively you could just close these descriptors - that would tear down fanotify instance and all events will be auto-accepted. Honza -- Jan Kara SUSE Labs, CR