From patchwork Sun Dec 30 04:49:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10745051 Return-Path: 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 0BA611874 for ; Sun, 30 Dec 2018 04:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E016228715 for ; Sun, 30 Dec 2018 04:50:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCF2F2873A; Sun, 30 Dec 2018 04:50:04 +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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY 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 0121E28715 for ; Sun, 30 Dec 2018 04:50:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76A888E006D; Sat, 29 Dec 2018 23:50:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 717238E005B; Sat, 29 Dec 2018 23:50:00 -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 6056C8E006D; Sat, 29 Dec 2018 23:50:00 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 1D3618E005B for ; Sat, 29 Dec 2018 23:50:00 -0500 (EST) Received: by mail-pl1-f197.google.com with SMTP id ay11so20558960plb.20 for ; Sat, 29 Dec 2018 20:50:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=lcjD1zBeERRxJjf2F3hugdxuZivyMNd/i0PSrUp1gXo=; b=T2s7Cn/85+bwzHkBoMEC+At7ZwnxRyp8+Ela8/quB94Dwr8hLMFPXm8BBY9Cq47Wnh 7dE7aZygCRjkMbf68MF+goLUnHGAAluK619iTXqFT1KsSi7JhejT5Q4z73DJUVTQS5nB F9jzfnJi+SnOh7b9kcmr5sEvPsFzVmnW2GOydwkd5dIFKVnNTZ8899jQRvnVzd4PsyXc glVzhmrr0AImrR7tTEk1eKpa12020GwRfEQHs0KqPCJ+gWUp6hW5w0zYSBt84Wl+8RMq efCdkEH9NMv0hdp9hZpvs4IL7yYDOLL/oQNoJSTLPFN/brVzswor9w0xpVGkX4Beoppw 83jQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: AJcUukcYSFEegHbJ0f1CaDbrsJPQ9jZ40ProZ5hnh1iyl1vqCh/1rHxK rkiP3QxfxE0/j+gNErpblPF5+t396ufeiTL2D6CzFFNE/QB5LA/RDhXHzTnWMV9kkigLmt6L+FM hda1HI3BZSpz6dKx+1mvG2fVWNPnMVCRBX8RPFuUhcjFUfHAV/brdrpBxGC86nSkcQA== X-Received: by 2002:a17:902:2ec1:: with SMTP id r59mr33544671plb.254.1546145399661; Sat, 29 Dec 2018 20:49:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN6GkiayxC2pHIoQ8ivrwscsJ/MktvPHCum7X6a+imEP2QZqGduTzsKWJWRJZ7yoWNp+TN7r X-Received: by 2002:a17:902:2ec1:: with SMTP id r59mr33544649plb.254.1546145398893; Sat, 29 Dec 2018 20:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546145398; cv=none; d=google.com; s=arc-20160816; b=kywy6xZsgQtPLPJRbsdNZEdlDXcujxa3DNhucx4q18tZJDAgGJfIw1lzSRp8Or17Ex QInNOzX4eCE+JcgAIUgnenNlJA7zTJgQjbPINK6KVOcY5Tj5Bgd/U7hiV2yKP7WAZlYg T4p9CeynK+47mYOeE+ny01hWS7WnYsrSTQ1QtetgQfyPBFdjX/sXh7SxXWJzDb9Fs1Nx WCAx/g5p40i73yVYDJ1+EF7ZsZaXV7dS959m2u63ABFrrkzebAoqosHz4R50LU00/3iS J2HNsgfjAHDYqo2cRTsXdZxOc7HdkfAof8MZu2FkzfHReE2k7A2jL75hXZ8qqaKeH2qf BR8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=lcjD1zBeERRxJjf2F3hugdxuZivyMNd/i0PSrUp1gXo=; b=iCsX11ECgxfljnaiedczvYx3mnvomQr+qc/lSyY7Pe85qO/zkR+mAF1C1wNClokX0L TYB4K1ha0ak8cJ9owtfh7r3li4ophW/dcvWbrGHxE9wFERKs+4QZqLoVn97Cu1IC+i+D 9Ux5mlQFe5it57+PSaWxT3A3lpCHw7D3hnhj50Oe/l6A4z/TMK7f/fZ2JYRZFskq74bw 34kREFEV9oMBHGiCyyrIq0svuR95x/0aDkIAd1K6y6mW8lMxNVpY9TOxz4sqPz6jTKiW v16XN//VJIJPEK7sITSPuuPZEWqO9iP84ui3Elz5jnPaSv2UHnnxqvnJFNlPdlKSa6M6 v/gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com. [115.124.30.130]) by mx.google.com with ESMTPS id i20si42118143pgh.187.2018.12.29.20.49.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Dec 2018 20:49:58 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) client-ip=115.124.30.130; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07449;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TH6r6Yk_1546145375; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TH6r6Yk_1546145375) by smtp.aliyun-inc.com(127.0.0.1); Sun, 30 Dec 2018 12:49:44 +0800 From: Yang Shi To: ying.huang@intel.com, tim.c.chen@intel.com, minchan@kernel.org, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v4 PATCH 2/2] mm: swap: add comment for swap_vma_readahead Date: Sun, 30 Dec 2018 12:49:35 +0800 Message-Id: <1546145375-793-2-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1546145375-793-1-git-send-email-yang.shi@linux.alibaba.com> References: <1546145375-793-1-git-send-email-yang.shi@linux.alibaba.com> 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: X-Virus-Scanned: ClamAV using ClamSMTP swap_vma_readahead()'s comment is missed, just add it. Cc: Huang Ying Cc: Tim Chen Cc: Minchan Kim Signed-off-by: Yang Shi --- mm/swap_state.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mm/swap_state.c b/mm/swap_state.c index 78d500e..dd8f698 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -698,6 +698,23 @@ static void swap_ra_info(struct vm_fault *vmf, pte_unmap(orig_pte); } +/** + * swap_vm_readahead - swap in pages in hope we need them soon + * @entry: swap entry of this memory + * @gfp_mask: memory allocation flags + * @vmf: fault information + * + * Returns the struct page for entry and addr, after queueing swapin. + * + * Primitive swap readahead code. We simply read in a few pages whoes + * virtual addresses are around the fault address in the same vma. + * + * This has been extended to use the NUMA policies from the mm triggering + * the readahead. + * + * Caller must hold down_read on the vma->vm_mm if vmf->vma is not NULL. + * + */ static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask, struct vm_fault *vmf) {