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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D849C7EE22 for ; Thu, 18 May 2023 08:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjERIQp (ORCPT ); Thu, 18 May 2023 04:16:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjERIQk (ORCPT ); Thu, 18 May 2023 04:16:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF26310D0 for ; Thu, 18 May 2023 01:16:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7ED6F647E0 for ; Thu, 18 May 2023 08:16:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFB25C4339B; Thu, 18 May 2023 08:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684397798; bh=u4N5s5RzImHaTfp18DwzdbANHCGhKwG99M7Qtmr7Vp0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mjQ0XqRWMp7+/p6DmBQ+47YMSdEedt1UquGqUhkhiY1xqKUJn1Fw66JdqI3VmQw+s C/lXPuwPYzNBoQC17STDr7VUDf17rl71CmamWt6ezDHfcB2S4FOfYwEUWSS8sEBRI9 gB82/xUkGZilsGa59PD2CzJr89yfvwOI/LZjMObPa5jfg0eHVOF0kYkriJCDsllZ2k N7WG7SI2AeHs+Ciwc0YAgs/Jvbsjm2n9yOwhSXyomlv9nEhtDHRj0E1fjTL0WDzPsX yKWxunNaAlVDOJRdTZBz0yJe3B7S+Qtb6y+000qp/7qNwwEo9AD1HxxG/J+7IxBu4s KsTAAJlSOMtcA== Date: Thu, 18 May 2023 10:16:32 +0200 From: Christian Brauner To: Mike Christie Cc: Linus Torvalds , oleg@redhat.com, linux@leemhuis.info, nicolas.dichtel@6wind.com, axboe@kernel.dk, ebiederm@xmission.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, mst@redhat.com, sgarzare@redhat.com, jasowang@redhat.com, stefanha@redhat.com Subject: Re: [RFC PATCH 2/8] vhost/vhost_task: Hook vhost layer into signal handler Message-ID: <20230518-zuschauen-windhund-48949c34a524@brauner> References: <20230518000920.191583-1-michael.christie@oracle.com> <20230518000920.191583-3-michael.christie@oracle.com> <3c2adf29-c201-9534-cc07-d35c4dead948@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3c2adf29-c201-9534-cc07-d35c4dead948@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2023 at 08:01:45PM -0500, Mike Christie wrote: > On 5/17/23 7:16 PM, Linus Torvalds wrote: > > On Wed, May 17, 2023 at 5:09 PM Mike Christie > > wrote: > >> > >> + __set_current_state(TASK_RUNNING); > >> + rc = get_signal(&ksig); > >> + set_current_state(TASK_INTERRUPTIBLE); > >> + return rc; > > > > The games with current_state seem nonsensical. > > > > What are they all about? get_signal() shouldn't care, and no other > > caller does this thing. This just seems completely random. > > Sorry. It's a leftover. > > I was originally calling this from vhost_task_should_stop where before > calling that function we do a: > > set_current_state(TASK_INTERRUPTIBLE); > > So, I was hitting get_signal->try_to_freeze->might_sleep->__might_sleep > and was getting the "do not call blocking ops when !TASK_RUNNING" > warnings. Also seems you might want to check the return value of you new helper...