Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2507587ybi; Thu, 4 Jul 2019 12:35:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJzNwSW1Gpwohj4KPoAigaZ3twX58sBgORPYh15ciqSpUuLeGSXe0p2H3y+DEyxRPD/YB6 X-Received: by 2002:a17:90a:a116:: with SMTP id s22mr1225251pjp.47.1562268958018; Thu, 04 Jul 2019 12:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562268958; cv=none; d=google.com; s=arc-20160816; b=ToPKAYVaV6//ZaWGcdJwZPVRf7VX2pf7oeTsoabU2cGzgPEimJCDO6CUtcKiScKGYu Luze6ph6JXIFb1nDdEGmkHYkT77G8yxowNoXzSMH8n++Aa6ApMaa66GSR6e5XNPw93rP a653+/SlUFCWsP4oVWI/xkkbudWDlt+JIjYmQsDmG8G9nB1DozJkmIGCe9DflSmxuG7l DOEceC2+LCLJqsj2E9yHQOFqPkduHfAkc/mL1m6iehkJ21uo2yT8V76DNPR9Pnjos2ll tSz8U8ROq21Il/IKJ5pck7OnTAS/QXGrUaPdLpVMEpZbbLg1gEo3RM0sy7YBZQNYTxYx vQ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=sDn9pqNnZNQls6TlQC0E4i4OA5fVIAHZsv1mK7QjuUU=; b=HGpPGykVAv5L5mhs7T4pB7hV8jhb9+2KwePzQi7wACJ59lTqYYM3gCvM6TWkOLWZky ATXnqnLswrHV/+UUM93ek/xv/ICS7aPmHPz02G4czCIAGRzmj7XB9iMibPaRvt+KplG5 kIzL5R81FvKzUave1TG4BKjtRKCo/2T1oiJWlia7VC0rUAST42Kd7SUqmHb5MYEhs9Rd mE6ctWKb5Oft4DQRqSjq/oHQXz4XktRermNxDjnlaLRrn2eO08Xu8Lrlr4OicxzIGGJ1 n3mNNe0gFRJvjmQVGhzx0UqnagkvZBdTmjnSmldi128ABCE5i2OybyWGYbrDnSgvSHxV bs9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xLYlLoVc; 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 q185si6268274pga.565.2019.07.04.12.35.41; Thu, 04 Jul 2019 12:35:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=xLYlLoVc; 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 S1727146AbfGDTcU (ORCPT + 99 others); Thu, 4 Jul 2019 15:32:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbfGDTcU (ORCPT ); Thu, 4 Jul 2019 15:32:20 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D707D2189E; Thu, 4 Jul 2019 19:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562268739; bh=sDn9pqNnZNQls6TlQC0E4i4OA5fVIAHZsv1mK7QjuUU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xLYlLoVcNxDZe4xjXUvwx/phI6Gk2I2s1MqHsJnhvK2dhiM5vmmOgxqD3KpPOq1GI YZNDgDS+RHGtv/QAuLWVM4LeZoRGCgQfTba6bUvfTmu8bvT07N8/18ASofU5gvPZM6 qTzELQghgD4BvffARvPi77TQK27tSY7dRePWiBGY= Date: Thu, 4 Jul 2019 12:32:18 -0700 From: Andrew Morton To: Oleg Nesterov Cc: Qian Cai , axboe@kernel.dk, hch@lst.de, peterz@infradead.org, gkohli@codeaurora.org, mingo@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins Subject: Re: [PATCH] swap_readpage: avoid blk_wake_io_task() if !synchronous Message-Id: <20190704123218.87a763f771efad158e1b0a89@linux-foundation.org> In-Reply-To: <20190704160301.GA5956@redhat.com> References: <1559161526-618-1-git-send-email-cai@lca.pw> <20190704160301.GA5956@redhat.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Jul 2019 18:03:01 +0200 Oleg Nesterov wrote: > swap_readpage() sets waiter = bio->bi_private even if synchronous = F, > this means that the caller can get the spurious wakeup after return. This > can be fatal if blk_wake_io_task() does set_current_state(TASK_RUNNING) > after the caller does set_special_state(), in the worst case the kernel > can crash in do_task_dead(). I think we need a Fixes: and a cc:stable here? IIRC, we're fixing 0619317ff8baa2 ("block: add polled wakeup task helper").