Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp752123ybz; Wed, 15 Apr 2020 18:10:54 -0700 (PDT) X-Google-Smtp-Source: APiQypJAUoxKb9qz6WCsijqKhTJGRKw+KmWeVyywILylLRQU0EkCc2UaFqX0uKQ1vJLIr/N+y4o3 X-Received: by 2002:a50:eb8e:: with SMTP id y14mr10589314edr.270.1586999454061; Wed, 15 Apr 2020 18:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999454; cv=none; d=google.com; s=arc-20160816; b=pDYMuHhPdaRFt2jJqhfniRRxkXIcmlAA+tBRE7z+lMw+JDEIJlO9ID+9KPoAgx04rh panV98Ag/jQGKokL9FCTAUOhVuniSuzaOm1a9YCD1yFPUteiV8JfTRUyzxsuf289pSQ4 X6rwxTFHmrF5SiE8c6C5kxuy2Qz5GB/1ZZmNKmiJ0vZyufydbg+c9DKBerRgCnf/NJOM Mik4g5SMtxEfzqZnY7DNHED6SIb0H/X0gQVxCboH3Vw2fiZpqIIPPazpMP6SvTQi3UiB kmS8cVeMVg0sQYmhKDiWB5fbU76VU6DwqqNkr0Nsqo2a38xdhrK5ZCeqLgYfXALczBWq Xrng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=j4CoJdpyAxiwP86EqEb4FeVGZdyPJQL3T+607aQ1K+Y=; b=DBWioHaE4ihzv6rZ9R9+pPCjsgm/RGYsdoIdZauH7ti+Cujp6kamd68PJilHkASsWp prsYALf6bRAAEoLuUSuLuvnCCjioQBMiHY3XuZAzsHg4OnssVTy04VjqovdvwS9YqMIP udD8LN/XOEfdibdD0S5XXa+0lkq36T7JWTL8PbumIHIIQ4nHv4rYhHNJIwqbvQRD6Ify DjLtYu9MPybHQkWQOBF9AvC+/+Okhe1TQzQ53J4mhXTNXMLdOrK4u2A88Dqp5eY9Y/jO Xvw8V6zl2ignE7BkDBtcWB52Bs2npqsRX4hfD/Aep/J/9cmT9Eo5ekZFd9qAS+GrnlgJ N87Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vv6K5mdG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si309125edq.413.2020.04.15.18.10.29; Wed, 15 Apr 2020 18:10:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vv6K5mdG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729985AbgDOVoh (ORCPT + 99 others); Wed, 15 Apr 2020 17:44:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:42132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730409AbgDOVo3 (ORCPT ); Wed, 15 Apr 2020 17:44:29 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAF8B2076C; Wed, 15 Apr 2020 21:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586987067; bh=d70WE9UrG3WG2ng9rKQE35xkTHOeB3Njfu1omBSNyRo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vv6K5mdGmd/tAm9iNBNZO+qoEN/QyNrfO/tcJVi+jO+e318ZSnVlh3a7LaFjvzYxP Hg0aPElrm+JCbdWq9R49xgZt3N/ZJfgz4jszW8zlBcfl9JX5+PTRhhlNi01fwNO20+ IfqccJ45QkqnX+0Zgl3VuuM/GdgPGCoa+e6ZkelU= Date: Wed, 15 Apr 2020 14:44:26 -0700 From: Andrew Morton To: "Kirill A. Shutemov" Cc: Andrea Arcangeli , Zi Yan , Yang Shi , Ralph Campbell , John Hubbard , William Kucharski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv3, RESEND 6/8] khugepaged: Allow to collapse PTE-mapped compound pages Message-Id: <20200415144426.a146ef173140f5bc396a6dcd@linux-foundation.org> In-Reply-To: <20200413125220.663-7-kirill.shutemov@linux.intel.com> References: <20200413125220.663-1-kirill.shutemov@linux.intel.com> <20200413125220.663-7-kirill.shutemov@linux.intel.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Apr 2020 15:52:18 +0300 "Kirill A. Shutemov" wrote: > We can collapse PTE-mapped compound pages. We only need to avoid > handling them more than once: lock/unlock page only once if it's present > in the PMD range multiple times as it handled on compound level. The > same goes for LRU isolation and putback. > > ... > > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -515,17 +515,30 @@ void __khugepaged_exit(struct mm_struct *mm) > > static void release_pte_page(struct page *page) > { > - dec_node_page_state(page, NR_ISOLATED_ANON + page_is_file_cache(page)); I have dec_node_page_state(page, NR_ISOLATED_ANON + page_is_file_lru(page)); here. Is there some prerequisite which I wasn't able to find?