Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2367848ybi; Thu, 20 Jun 2019 13:55:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzE8wA8EJTxD82qxkEqAfDjs1lXk1SJcNOOncDdnxec5OtCKwiYWKd/5Pgiejiu00WErJB0 X-Received: by 2002:a63:f146:: with SMTP id o6mr14196102pgk.179.1561064152498; Thu, 20 Jun 2019 13:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561064152; cv=none; d=google.com; s=arc-20160816; b=S29BYE9rct087X0GfdkSCckaJonxtfSbraPkHn/nJ1FQt27Ef6WVwSGIaqVRW5LSOg KMoYM3ljpDTCLo1RSijUd0Xf0Z2HwkKXvtMYAuYvixrhnw9LhgilhpE+GiaWRGtYP6qp W2x41C0rkrO7fUvM1A1yJaH4ydoOa5Zxl2vbQdtCJULF3IFDOlaKXrKKzcTX5JzMSeWq jKUlE3ebNiWVxZ+VHdx2E9SLSz29PhYz+MI9K3uz5cKeLERURXgZ6NCH/Sn1Bx33Vp8R shYiLd+L0DGLvQa33XphgogCkNkQ2TIxNRXiQ5THvj7NjTXoV3UcU1ZQsWzizYdm+tIB lkCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:smtp-origin-cluster:cc:to :smtp-origin-hostname:from:smtp-origin-hostprefix:dkim-signature; bh=n2snFM7QmmPTPpShlBhEnsGKC2i2/uKCmCMTseCu52k=; b=jjPdK9KLEafY47EvaTzd8VOMYmJTP7CraNxqsftGx9k1umPO/w0nRy/tcxJisE37NV o47InOTtrOIDWKZ4TqRZDoZGhityCh1Pb+jOD/dm/rfCe34CIWodVt1d8UIfKHmwGu+4 QkY49dOmU0azICG+dipSwJNzxXjsgpu5qv4roex7gxVzzk0B++4fZMD8uxZUS8MyQyXf RKAhpjl/YczT44YTBl7ApT/2Sf8yc0rFv4pd+Oqf0izVA+YqEyQWhz9yXIlw+Ft0B4LO sjxSB8WXEBjlNhs2oq7JYJJj9UJ0ob1UrbSkzFYpnN0QaY/BSn8CmDy9D+NRxEb8DRV8 W4SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b="MO6t/uuq"; 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=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s34si746258pjc.2.2019.06.20.13.55.37; Thu, 20 Jun 2019 13:55:52 -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=@fb.com header.s=facebook header.b="MO6t/uuq"; 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=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727221AbfFTUyg (ORCPT + 99 others); Thu, 20 Jun 2019 16:54:36 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:22256 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfFTUyI (ORCPT ); Thu, 20 Jun 2019 16:54:08 -0400 Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5KKr3CM022769 for ; Thu, 20 Jun 2019 13:54:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=n2snFM7QmmPTPpShlBhEnsGKC2i2/uKCmCMTseCu52k=; b=MO6t/uuqWiOOomNBwU97YOg+TXttbjxehR5XUim4OqdKWGOalMKxrKcMTqcpsoFCSNTE v2Tyx+5GHTxXTSPAKkK7icdV+5yVIe0Ew+tP8foHoFHqdgSuCNXYJKLQy9typVFfpkod AIK/nAgzi7COfwqaGzTulaxsSRSMbugt65w= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 2t8gch8935-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 20 Jun 2019 13:54:07 -0700 Received: from mx-out.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 20 Jun 2019 13:54:05 -0700 Received: by devbig006.ftw2.facebook.com (Postfix, from userid 4523) id 06C3D62E2A35; Thu, 20 Jun 2019 13:54:04 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Song Liu Smtp-Origin-Hostname: devbig006.ftw2.facebook.com To: , , CC: , , , , , Song Liu Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH v5 4/6] khugepaged: rename collapse_shmem() and khugepaged_scan_shmem() Date: Thu, 20 Jun 2019 13:53:46 -0700 Message-ID: <20190620205348.3980213-5-songliubraving@fb.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190620205348.3980213-1-songliubraving@fb.com> References: <20190620205348.3980213-1-songliubraving@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-20_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=570 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906200150 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Next patch will add khugepaged support of non-shmem files. This patch renames these two functions to reflect the new functionality: collapse_shmem() => collapse_file() khugepaged_scan_shmem() => khugepaged_scan_file() Acked-by: Rik van Riel Signed-off-by: Song Liu --- mm/khugepaged.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 0f7419938008..dde8e45552b3 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1287,7 +1287,7 @@ static void retract_page_tables(struct address_space *mapping, pgoff_t pgoff) } /** - * collapse_shmem - collapse small tmpfs/shmem pages into huge one. + * collapse_file - collapse small tmpfs/shmem pages into huge one. * * Basic scheme is simple, details are more complex: * - allocate and lock a new huge page; @@ -1304,10 +1304,11 @@ static void retract_page_tables(struct address_space *mapping, pgoff_t pgoff) * + restore gaps in the page cache; * + unlock and free huge page; */ -static void collapse_shmem(struct mm_struct *mm, +static void collapse_file(struct vm_area_struct *vma, struct address_space *mapping, pgoff_t start, struct page **hpage, int node) { + struct mm_struct *mm = vma->vm_mm; gfp_t gfp; struct page *new_page; struct mem_cgroup *memcg; @@ -1563,7 +1564,7 @@ static void collapse_shmem(struct mm_struct *mm, /* TODO: tracepoints */ } -static void khugepaged_scan_shmem(struct mm_struct *mm, +static void khugepaged_scan_file(struct vm_area_struct *vma, struct address_space *mapping, pgoff_t start, struct page **hpage) { @@ -1631,14 +1632,14 @@ static void khugepaged_scan_shmem(struct mm_struct *mm, result = SCAN_EXCEED_NONE_PTE; } else { node = khugepaged_find_target_node(); - collapse_shmem(mm, mapping, start, hpage, node); + collapse_file(vma, mapping, start, hpage, node); } } /* TODO: tracepoints */ } #else -static void khugepaged_scan_shmem(struct mm_struct *mm, +static void khugepaged_scan_file(struct vm_area_struct *vma, struct address_space *mapping, pgoff_t start, struct page **hpage) { @@ -1722,7 +1723,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages, file = get_file(vma->vm_file); up_read(&mm->mmap_sem); ret = 1; - khugepaged_scan_shmem(mm, file->f_mapping, + khugepaged_scan_file(vma, file->f_mapping, pgoff, hpage); fput(file); } else { -- 2.17.1