From patchwork Fri Dec 21 21:40:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10741073 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 223496C5 for ; Fri, 21 Dec 2018 21:47:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12A9D2861C for ; Fri, 21 Dec 2018 21:47:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 044402863E; Fri, 21 Dec 2018 21:47:02 +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 92CF92861C for ; Fri, 21 Dec 2018 21:47:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 948AF8E0012; Fri, 21 Dec 2018 16:47:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8F87B8E0001; Fri, 21 Dec 2018 16:47: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 79B9D8E0012; Fri, 21 Dec 2018 16:47:00 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 392578E0001 for ; Fri, 21 Dec 2018 16:47:00 -0500 (EST) Received: by mail-pf1-f199.google.com with SMTP id b8so6145742pfe.10 for ; Fri, 21 Dec 2018 13:47: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=F33vEK5RIdq1NoXfDjRoBYOEB0M1ryGRQ3wYD2Ss+VSIIf2AJK5yWiC+JqNbVjho9K EyVMzaoEXohlmH2mdgrfn4mdqlwqvOcKl0w+HFqxxnfc1vMPn86FwS6G1aHGeZZKkh3p 5JSSltPClsAz/DFAHtaS4m8BuoMizFdnZBUFar/L3JKLl+GHH+H/du3WuYr+7RB2pUkI DCMMtNo2HMTIMxWQmC++YXFkkk8MSWAT3nzUAdJIa1NiU2ui65cmQp/8nKos/ncIIUcn zjwL7N7bAgc7hjC5BtGRDWaddtcpCBsx2F+LtaTtn1yyPLFbaKpyM0UZlOS6tOuCkxkj ss3w== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 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: AJcUukei1iBeNBgmTvjfAOduWp/EW9+PtNk3j9joThcywi/k/aDCAujO Zwmg917X1RcOIAdk54AebHWPPm0SdZhYR64k/iW2iqCuK/rbU/M+4Isq/5awRhpZH9mkz9tXSLT WQOI2a6edr6ZhO8ccFwa/z2ltMhxLANGz4pS/8UuXTuzwNBaHVrwiR5HKevQoihnhTQ== X-Received: by 2002:a63:fb4c:: with SMTP id w12mr4021509pgj.321.1545428819849; Fri, 21 Dec 2018 13:46:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GZ4dTQpBzTGqoVlPswdwb3+gEWKGXi4WEQLR4Dx0FkqbRjx/R6deUuhv9wyo65tkWO4a3 X-Received: by 2002:a63:fb4c:: with SMTP id w12mr4021476pgj.321.1545428818909; Fri, 21 Dec 2018 13:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545428818; cv=none; d=google.com; s=arc-20160816; b=CgiDM4UWVNN1rTjbDCODWUGPDZJ+4VKm1PIS78RkxttB6av6YMhDyOHxpOouKHNhx6 zPcZcl06IAHXxZAiLb3zRroeiT41IBbsV7iMPC74wVn+a2jsvbhwXsCOzL6K4gxC3CiB N56GJEC7zjxxiKA3eXXp70yYrxHccd/k1kIHTZWHCPkYbp7LmYCmwcv8eRXSeNu12BLA eV3y+k5gOaWLoIYE4/OvDA1Ujx6nqh8nJ6D7EUngDF2iVcz3GZZLkLLTVTbfBz1GYFsX RKDIXcrbpPm8hwyXGwPjl+M50qTelf4LKAse+KoQAru3u2FQP6+H2W1zoi+o+VgOQ45C cHeQ== 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=jNMenfY96fu8UhEzsPHFHZvoGoJWwrGk6t56kZZLneS3GjbEicp7Il5xBjpmcxTtuk XvEGmsxWheBKe6YSbJDGa0LeN5GH4pJgCwT93v6zlbIXXppN2E4FiaH0RMe02TunhbDk zOlSYpyld6IvvqcSKoZeAz56pTAQIwrqLQGmFMPGyijx9se5xdGo+9oJR4a11jHGm8YD BjfNXX0BFWCk1D5z2ckpYr4NedQ2pd3JgDhWS0FGsBmZz56yS0nirDfZ5rZ2DMmxygkN bj4E4DtJ5xyjyy2GnUSNJsFFVBCGPRIAWBn1NKvAx/j9vWLyUUphjmWNH36dcCGY7iPJ t3jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out4436.biz.mail.alibaba.com (out4436.biz.mail.alibaba.com. [47.88.44.36]) by mx.google.com with ESMTPS id d23si22376637pgm.559.2018.12.21.13.46.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 13:46:58 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) client-ip=47.88.44.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 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=01201311R111e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04428;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TGLFtxI_1545428421; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TGLFtxI_1545428421) by smtp.aliyun-inc.com(127.0.0.1); Sat, 22 Dec 2018 05:40:28 +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: [v3 PATCH 2/2] mm: swap: add comment for swap_vma_readahead Date: Sat, 22 Dec 2018 05:40:20 +0800 Message-Id: <1545428420-126557-2-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1545428420-126557-1-git-send-email-yang.shi@linux.alibaba.com> References: <1545428420-126557-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) {