Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2584315ybi; Thu, 4 Jul 2019 14:30:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxODzTzKfOv6nHuxn7n7VarUjBcup1MVq2NT2IBPPVZvHWbvkjsixs98zZiC9vlw6rwu4gR X-Received: by 2002:a17:90a:bd0b:: with SMTP id y11mr85598pjr.141.1562275829943; Thu, 04 Jul 2019 14:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562275829; cv=none; d=google.com; s=arc-20160816; b=uywDNOQggPSk4ELA1kX1e8SQ6y/rVz9TFUaQCd7VqEoFG3G/tGSVOOS6pD6B+Y/Wl5 uZMFa/+9hQBc8feZZ2+5uduFRXX6sQYo3XrpJKGzKlybbpZtIteJNfYTHtqmbDYDbOxz nQb9XyMaa5tNtB7GyXnC1jwXeE8tOkK0hzb7H0Yw/x2GgJnA+dOZQSvfnxLggSFmG3d7 ag7TtnU2USTESayG/FE8mUcn/lzdDtLl4ke1azSj1032xNbKKR3x+0gwQhDc1mMFwrFs OYmbUShuNI/CRWn9RvK5xUHid6vzpAMS/AjawaKCt5Qv7Dl0fPixw2E7GmZVqX3Xq7xO sHzg== 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:dkim-signature; bh=MQQ07rB52HYdqZ61pXH1qpFuHoSeCNE8eQWm5DgwWXQ=; b=BH9+EH/ceLyOtCH03Y1JWxv/95oGF0f4QUPWugqdsCv2H4oIuGuCVWQKYqPj5fFTnw o7t7H47tmziXJDbb74U5v7ME1qj0I7s7pkCUtalhVIWXsYIW+0PxueNW1PN732pbnL3X h7bC9B8i0EOYCbjnwRPpaIMm2ZV94jdKGkMovJrInCNqeT0B7y3VCoMbfghpcWcv43we scYqhVxI9hiPVxXNezdP7voldLb9T33EtAPb4z7EI7WNjYKOahO1B9jXDtoJJ3RXSYPW Rtkx1HQHtIwAYoxd4d5chOnQuH2TBo25St1E/dlDXUveyGI/kfSEKrRzXS64gMVOp8br pCvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=e2h82MMx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si5891058pju.90.2019.07.04.14.30.15; Thu, 04 Jul 2019 14:30:29 -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=@google.com header.s=20161025 header.b=e2h82MMx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbfGDVPy (ORCPT + 99 others); Thu, 4 Jul 2019 17:15:54 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:44214 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfGDVPy (ORCPT ); Thu, 4 Jul 2019 17:15:54 -0400 Received: by mail-ot1-f67.google.com with SMTP id b7so7038754otl.11 for ; Thu, 04 Jul 2019 14:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=MQQ07rB52HYdqZ61pXH1qpFuHoSeCNE8eQWm5DgwWXQ=; b=e2h82MMxM5QusbuIi3nIbhQZEHtR5kFU/nUkkFZx5sWrINuwT/dfST5LGTGrdk0of0 Rxutpk8embd/ZBpeCuB4tF2xstGtmG3VhwWYmzEgblCfleeE1WJyQbpvzU7CTc7azKiH 1clDKRW77SjF7lLqXyEQlgH0LF6A0i58ndW2LtlPMyT7Gcvf2aWACIGJwAHPGNDiTi3O HcvqV6iu+Eb9yIOndD22y66tjf2hG9i5gjODvkaLAnLrKf2cw3bavtwQRgwfAlGyRNTm qmiBMYH8jFIXRWcRMnYUovXZ6h6iAIuC/vlo4Vz+Euk37hR4t8wr1fIG7e/o6Cq8AMm3 Eh8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=MQQ07rB52HYdqZ61pXH1qpFuHoSeCNE8eQWm5DgwWXQ=; b=to+zm20BuRnz0Jfl+UwGT0GeVUASsyaAgSmIvi8ml9IY2iGkU7zBysi53+0SzgHzwS TFzRX4CkzNltAUV6zDmvd9ZRgPGiuhIYcet37fChpojrBcAVJ8Jad7xu/yp06prtVCGw l7z4kECOKU3tiOylI9SJPGTbowDgAyDvMpiVOOI1oQxiS7NNiIvNu+ZDynx9kwuuYVic 25l1PitEuAirJCZa6LCTcVXwbKaah/GhBaSHvsCllJeErE+95dVliGCAN4ddmzszgwMR IluImZlcEbEW/35wqorK78i0aJLHe9L6rOrOJf3pc2U9WMCh4+8ADhc5WdDOFmE7Nsmw 2W2Q== X-Gm-Message-State: APjAAAUXLKUE0cZ7uYVnD2O0flPv4jdmWiUNMV/rao+JG1pkTDpqaXa6 J5+5y3hDVfYp+ViHYQWywhUi6g== X-Received: by 2002:a9d:bcc:: with SMTP id 70mr62005oth.210.1562274952935; Thu, 04 Jul 2019 14:15:52 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id r25sm2277692otp.22.2019.07.04.14.15.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jul 2019 14:15:51 -0700 (PDT) Date: Thu, 4 Jul 2019 14:15:33 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: Oleg Nesterov , 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 In-Reply-To: <20190704123218.87a763f771efad158e1b0a89@linux-foundation.org> Message-ID: References: <1559161526-618-1-git-send-email-cai@lca.pw> <20190704160301.GA5956@redhat.com> <20190704123218.87a763f771efad158e1b0a89@linux-foundation.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) 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 Thu, 4 Jul 2019, Andrew Morton wrote: > 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"). Yes, you are right. But catch me by surprise: I had been thinking this was a 5.2 regression. I guess something in 5.2 (doesn't matter what) has made it significantly easier to hit: but now I look at old records, see that I hit it once on 5.0-rc1, then never again until 5.2. Thanks, and to Oleg, Hugh