Message ID | e15243a8-2cdf-c32c-ecee-f289377c8ef9@kernel.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8D0F1057 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 5 Dec 2018 13:49:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D859E2CAE3 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 5 Dec 2018 13:49:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC3412CB36; Wed, 5 Dec 2018 13:49:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6285D2CAE3 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 5 Dec 2018 13:49:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B78F6B749D; Wed, 5 Dec 2018 08:49:13 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 566116B749E; Wed, 5 Dec 2018 08:49:13 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47C776B749F; Wed, 5 Dec 2018 08:49:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id 096476B749D for <linux-mm@kvack.org>; Wed, 5 Dec 2018 08:49:13 -0500 (EST) Received: by mail-pg1-f197.google.com with SMTP id 202so11168016pgb.6 for <linux-mm@kvack.org>; Wed, 05 Dec 2018 05:49:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:to:cc:from:subject:message-id :date:user-agent:mime-version:content-language :content-transfer-encoding; bh=MVrFbYPO3q4ZPI76amp75bwA/EXb2iewzDhD2FbvKO4=; b=o6Hvs4tFoO3wVvi04Ho14nVwvUdiOZkYO76MRhlQPmnWn52NDM7F16Fo/AHDxAdkr7 kQBlSpLO1d3Tqutsjt/mj3LaFO/WBQnzH417tM7benT6Ar2YqmD+2tuREflMea/o5wk4 PpsnGIrIjOYYZ9LFQiLrX2SA85kxXmfuaSUCmIxqQLgaCUP1EfrNaHD2qH/9LQ2FneZO GTwJZM/lDQCzjzrseOvL4Pz14sl8TCdx80Qag7TIzYqAgfCvrQ2SfrzgE2B5yTZ7jAgA 69SYrl6JxA10eEPGiFlphLvOx8AbebnsLFDqwv3Kn0koDe6zHJ+8CmU83j2HdCa6Y8jp Ve+w== X-Gm-Message-State: AA+aEWZjhe+TCWUDLRM4E2QkyNbqUNOJ5JUPj7kqz2kmNmi4bTN8scCU PlE4N6Qni6fE7k6o9Rt4CkqvA6OA9woPgFJ8MQnlnor05IRyXenXXFxkib0y7Rt2qMudgEagceX Xq4S1vu2orG1PKiR0vuXu3qZ2KYLQxGs1dcyngo+KYhsI6cakE27CQUJJdoydMpvBtCzaskJnGU nd77GrTJWjUOBvlIgwRlVFdSQP4zk/MdW9zaAzMTbYEwi7XWV94zCzzBtTm7DujfYfudnWgG06/ GZmJxccxNIp9y/j4HBq/fdMqweiMenQsUv/6UcGkRG32x0oe4IkFL4/2p6RxEZcm9/1/9wQN48i 0u7qAbUM9si6KewKE/1o909Y6FPO/pbIY+QkAWMkqNExduRzkqize2rrDiGv7WCGQ3pVUrOptxR u X-Received: by 2002:a63:da14:: with SMTP id c20mr19613022pgh.233.1544017752721; Wed, 05 Dec 2018 05:49:12 -0800 (PST) X-Received: by 2002:a63:da14:: with SMTP id c20mr19612985pgh.233.1544017751806; Wed, 05 Dec 2018 05:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544017751; cv=none; d=google.com; s=arc-20160816; b=Xk2eq/S4nGLlDS5tdNB79ffGNdRMI9K/viYxx0Lkv9I7H7MXZ49W3fGDKb3d/cVmye TcHY0T+ksZ35ws2KE9yLbhyQbBPbRPcTwIx29/n3sH6IsImpmXvPEx/w3TvbQywfzMYO yJpXaJhbMe7adWE1xHV1Ymlcj2y6kPV3H4YuXBT92ILhmfVZYTqaxMgRQVnZ8F0NYkH/ yKYH1aH/MqirlVoZJTnj259HxwiopW1XX05bShzXREBzSmzKSr2SfSq86hOHzOiNjKrs 04a/q5B1Ss06L86ngZ/c3v4uyFwr1FjEnGscHIfrqyA6CLCmfolU4YbJlRPABKCGNeIX SMKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:subject:from:cc:to:dkim-signature; bh=MVrFbYPO3q4ZPI76amp75bwA/EXb2iewzDhD2FbvKO4=; b=YanUuLTuTGq5CCX0CwJg5hQyFFfEBMRFnZTaSSliAIuTigO/PNaWvg361mJwiKhf/Y z1M1wCmkcmwvwbGOzcwM/5Cf1fDMh0aJ+5EAq8kICAfFDljqiq9+VrlVoKNQUHoaFXJt kApzcVpUfQDCZvKcd70vANSj99QsU7We2pge5UTnh5JqU1I/7f24ck/2SZEKfrP0WzlU BQdx0WezQdYoPKl1ah6pwdPJBk7fkl0qSp2cqluakjVWHDMa+mAy8wNlK01uAE+b6zKm JPJlubH5hc42CpOWnWp3mvIvm7ayy1dbpqtIkizeTFjabnAKz6jPsJsAtN4r1LtD7i50 VnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=ZRpgDzcz; spf=pass (google.com: domain of axboe@kernel.dk designates 209.85.220.65 as permitted sender) smtp.mailfrom=axboe@kernel.dk Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w11sor26233940pgs.5.2018.12.05.05.49.11 for <linux-mm@kvack.org> (Google Transport Security); Wed, 05 Dec 2018 05:49:11 -0800 (PST) Received-SPF: pass (google.com: domain of axboe@kernel.dk designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=ZRpgDzcz; spf=pass (google.com: domain of axboe@kernel.dk designates 209.85.220.65 as permitted sender) smtp.mailfrom=axboe@kernel.dk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=MVrFbYPO3q4ZPI76amp75bwA/EXb2iewzDhD2FbvKO4=; b=ZRpgDzcz/4RI84muGDKgexIPhIJss5lrLViUOEf0fg13tj/2JZ+bA5NmqjSUfWbyWw CHHjuSsgU5jqbL45Rh4aB4rqFWw2oeEnPZ6z3AIOL9/LhdXU7HgYdycZCWmcnY+KoxgA uKF/SXHX75Pn5Re+cLYizsr7UBxTW4PwfY38biXJTAZ3r4Od6SexKkG1+WFhMelSevdi LhlVLDbUEBBBHV9oybyMqMIQneNV9VrYlDKD2t67noDRz261Hehr873gBIvu6hHcFoop xF9Xm0m2D/00msw0y6OeELPbSmbCYmQ8KS5iWWpmabPrXXRgoSGrCEuuuwCsv1vkQIJL +oOQ== X-Google-Smtp-Source: AFSGD/Ujff4WnOnv7R28rBGO+18p2GWCtCMhrws5OuGyUpVs51Y7eUm8Xty/UQRSmA3n/hyj0TGfxA== X-Received: by 2002:a63:1157:: with SMTP id 23mr20758874pgr.245.1544017751284; Wed, 05 Dec 2018 05:49:11 -0800 (PST) Received: from [192.168.1.121] (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id l19sm44914986pfi.71.2018.12.05.05.49.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 05:49:10 -0800 (PST) To: linux-mm <linux-mm@kvack.org> Cc: Andrew Morton <akpm@linux-foundation.org>, Christoph Hellwig <hch@lst.de> From: Jens Axboe <axboe@kernel.dk> Subject: [PATCH] mm: fix polled swap page in Message-ID: <e15243a8-2cdf-c32c-ecee-f289377c8ef9@kernel.dk> Date: Wed, 5 Dec 2018 06:49:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
mm: fix polled swap page in
|
expand
|
diff --git a/mm/page_io.c b/mm/page_io.c index 5bdfd21c1bd9..f3455f9f8dc7 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -401,6 +401,8 @@ int swap_readpage(struct page *page, bool synchronous) get_task_struct(current); bio->bi_private = current; bio_set_op_attrs(bio, REQ_OP_READ, 0); + if (synchronous) + bio->bi_opf |= REQ_HIPRI; count_vm_event(PSWPIN); bio_get(bio); qc = submit_bio(bio); @@ -411,7 +413,7 @@ int swap_readpage(struct page *page, bool synchronous) break; if (!blk_poll(disk->queue, qc, true)) - break; + io_schedule(); } __set_current_state(TASK_RUNNING); bio_put(bio);
swap_readpage() wants to do polling to bring in pages if asked to, but it doesn't mark the bio as being polled. Additionally, the looping around the blk_poll() check isn't correct - if we get a zero return, we should call io_schedule(), we can't just assume that the bio has completed. The regular bio->bi_private check should be used for that. Signed-off-by: Jens Axboe <axboe@kernel.dk> ---