Received: by 10.223.164.221 with SMTP id h29csp1951413wrb; Thu, 2 Nov 2017 03:38:00 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SA2zfK43WTdXSH9kQ5DBBe+E8oveHdoU3f3OLavxfXG+Cte/corALhbdDzxmFU9qKQAl/b X-Received: by 10.84.168.35 with SMTP id e32mr2756043plb.294.1509619080877; Thu, 02 Nov 2017 03:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509619080; cv=none; d=google.com; s=arc-20160816; b=djv700dKj0Po1FHWPPtPmnYmtDdUEo7ASW6OLraGkOfxVyqOK8qVfxFI0v6tFlGvb4 rgx+KANrRfXJTBsMYi6SQ5uYrfA5F8jjKYGGR2CXF0/Rxy6Qw44Vem7cZebbEW1jtf7L uSmZQMqkZWuLbILg/MxDh0llq2bzAbRN0AX9IIyUdl0cfXf62zayi4YjydIkO4lZ0RIb iyBUvzSuCBGKX3GSa6zTPOaAOiSEnhkg4xwh+ILsb1/h8NETuznFtiBXBfVCcKiPEz3a mUnsnhamIBnH80K1+RYEem4dCKBLLgAuZJD3iJeSWGpa4WdDhqo6xq5YpivBKnx1E0nb +kpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=zmhxY48Sv1vHAOqnKL4INqbOTITjYxG7NoGH0sbSuxU=; b=Bs8pcwUJhd97s7D7UkEeLCk2JzM8iXMExBxVzRa+bCd+JT/bsweLr/kcbPl9Xiiiwf NvI0K9IqlxybBa/OoM7roqRgdmG69FudP7x72cbcfVdoPxQTdukoiPPD4bTrKj11rrMr RBA3zuOIbDhlwkWYtPrR8W+k/lByTUxuVyb8MhuhlXtDYVSGdePoNn/yTyrQnNXKtHvl NNjAX/BiPtWXxiWqAwczSp3kEHY3ReSnaq0RfcZqmwptOCn6Sf80vX/uqqHcSMhnrxiu qdHuV2mcvXKtzZxA8YDwj9ZmW6VIRK1ZIh2wX/zupUIt9n32Z5GyUB+/bSuqG5mtIUzt gPgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si3102734pgr.403.2017.11.02.03.37.47; Thu, 02 Nov 2017 03:38:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755593AbdKBKgY (ORCPT + 99 others); Thu, 2 Nov 2017 06:36:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:59331 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755224AbdKBKgW (ORCPT ); Thu, 2 Nov 2017 06:36:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 803E7ABAF; Thu, 2 Nov 2017 10:36:20 +0000 (UTC) Date: Thu, 2 Nov 2017 11:36:17 +0100 (CET) From: Miroslav Benes To: Oleg Nesterov cc: Petr Mladek , jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org, lpechacek@suse.cz, pavel@ucw.cz, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Ellerman , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks In-Reply-To: <20171101164314.GA32760@redhat.com> Message-ID: References: <20171031114853.841-1-mbenes@suse.cz> <20171031114853.841-2-mbenes@suse.cz> <20171101151355.GG20040@pathway.suse.cz> <20171101164314.GA32760@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Nov 2017, Oleg Nesterov wrote: > On 11/01, Petr Mladek wrote: > > > > On Tue 2017-10-31 12:48:52, Miroslav Benes wrote: > > > + if (task->flags & PF_KTHREAD) { > > > + /* > > > + * Wake up a kthread which still has not been migrated. > > > + */ > > > + wake_up_process(task); > > > > I have just noticed that freezer used wake_up_state(p, TASK_INTERRUPTIBLE); > > IMHO, we should do so as well. > > I won't argue, but... > > > wake_up_process() wakes also tasks in TASK_UNINTERRUPTIBLE state. > > These might not be ready for an unexpected wakeup. For example, > > see concat_dev_erase() in drivers/mtd/mtdcontact.c. > > I'd say that concat_dev_erase() should be fixed, any code should be ready > for spurious wakeup. I agree. > Note also that wake_up_state(TASK_INTERRUPTIBLE) won't wakeup the TASK_IDLE > kthreads, and most of the kthreads which use TASK_INTERRUPTIBLE should use > TASK_IDLE today, because in most cases TASK_INTERRUPTIBLE was used to not > contribute to loadavg. Yes. Unfortunately, we have TASK_IDLE for more than two years now and nothing much has happened yet. TASK_IDLE is still used sporadically. I'd like to be on the safe side with livepatch and given that TASK_INTERRUPTIBLE loops should be prepared for spurious wakeups by definition, I think it is better to have wake_up_state(TASK_INTERRUPTIBLE) there. At least till all "concat_dev_erase" beauties are fixed (sigh). Miroslav From 1582882798193826211@xxx Wed Nov 01 16:44:30 +0000 2017 X-GM-THRID: 1582773844473281428 X-Gmail-Labels: Inbox,Category Forums