Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2732543pxu; Mon, 7 Dec 2020 14:14:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyx2+tazvOdhTJzadb/GBvcDrVVqoF0eEOSSbjI3dAg6iZnbn7nmJev1hvq318iuTzSfDQ/ X-Received: by 2002:a05:6402:1d24:: with SMTP id dh4mr21819275edb.161.1607379290408; Mon, 07 Dec 2020 14:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607379290; cv=none; d=google.com; s=arc-20160816; b=pcbDTgewoY5cETLR70hk6eHhqC1uB1noR9JBwSqArUC5AeFcZZRFknxHR0Z99u3SLx 9O9nQnokH0XC2ysfKgG7gOuVydhmnpLO+tuQ1ImXD1YGLdedGRpqqbCDi5wpKn69ipAG ADC+y2xsGxA1JlKv3REe7jVEv7ymx2Arf3vzH3eo5/W64OltFu5AA353lV74dWO6B1kQ eqiMxdDvk/ketrt27PoqPLedIyB6bYMNVA6BcYarn8KOPABpU/5Iy/2qIYe80UQdVvHT eBuTwWrJR7B9Xz69lN9PNpmF6tgGQZyIgpFRUgiGn1YiZHAN3gV+NjIFuc1j7dGIpjJJ MYZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=h0OiZUD2Xpj8wH+yrifT175RqRi+PBeb00G32sH3P0Y=; b=twwEMVorHtlnIZb/mPJoAUUjosj3Kx9DVcZ7uQwOSvjH1aL42d1H7pjr+jAWlJH8n+ MgVZ4Dr1dVcj8FYWZTAbGcjuErWSH1Y/ydl6XcZRegMFybZEP2bOzSOzI0/umDDIuz14 IGrBZNW07boW0vWSTSVCZips6FR5u2erd7JEmPtiDQW6ye+8PQa850S6w1jYE5/NXZdp BZy1NsqxftPxg8/eKr2vUMX/94RxEzviu1ehEquEpL7SxdnACP2nf4gFWB6PB7yc9wCr 2vVBhIdNNY0e06gZ+aLn4HUVtrzKGuuoOFAMEUMTK9TQH6mgjVZgml1juiONV/MYZnyF dbAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DvNTqP0J; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si7276400eje.114.2020.12.07.14.14.27; Mon, 07 Dec 2020 14:14:50 -0800 (PST) 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=@google.com header.s=20161025 header.b=DvNTqP0J; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbgLGWLd (ORCPT + 99 others); Mon, 7 Dec 2020 17:11:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727705AbgLGWLd (ORCPT ); Mon, 7 Dec 2020 17:11:33 -0500 Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF5DC0611C5 for ; Mon, 7 Dec 2020 14:10:12 -0800 (PST) Received: by mail-qv1-xf49.google.com with SMTP id h1so3845174qvr.7 for ; Mon, 07 Dec 2020 14:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=h0OiZUD2Xpj8wH+yrifT175RqRi+PBeb00G32sH3P0Y=; b=DvNTqP0Jlg37VPbc2IrU9Pi+z1DkfYcdpq+P8NKbSX5O4nR9+j1cJ/O7LgDhG6ijWS 5WJrRyQ9KRj2fcmKVTH6HUkEAC3mRxu+7jsql3dYH6K0bEbI6sQmRqfgK5T6Sn0lsNsQ FV2ifEGawMSAgN48r8Rk38P1zjpaAOaqsFPr7xuR9r6XpdYY8KWCUlLUBwWGdy2sC/b3 97xjHAFK+USl+MsFwNv1hwIoc9J3eGUDlJg+qVSMHN+ioy3g07+q1CtrpQA7AMlzd+Xi MRstm38sV1pNPo6mendy2h7S1ZhNp6ekXl1EEep86WN2Xr2a3m+olse1oMEm/wEdfDPT ipuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=h0OiZUD2Xpj8wH+yrifT175RqRi+PBeb00G32sH3P0Y=; b=FzCD3VcDwh+rAblgYcDJOBtff8BzvI9BFeE8uhCuPRZeI+3wzPN/DCIOHaRD+SMD+n 1t9s5ovG5d/XNJT7ijVmXnqzUP8biLZllhKs3OeUSBIKk/3NeEpH++oI7TSGi4qYLifi ltZDEEcl0WG6Tq74yY9RjYHEnpvOh9dL+7xy8ArEpG0sFu5Xx+OqXpTZokLM3jRC6Lbj 7Mmjn5QZvom51bbZF3cfmA/SN8MOZpaw+hWXaxNs2R5OUKeNcAJ3FOrZosnY3zoNYjN0 Nr3Ta0Fm79Qhvud3EeTXNRsTtQa0HA4NoNJTA9H9/sQeF1WwTn+uFaeAp/kcISlnO9uQ kY+g== X-Gm-Message-State: AOAM530cY6vSOaaXB1Pvq8cCmXx1KW7W3YQQbNQvtWGxXyVAlu74sVvy CAcmrdOnfZxNEwzXmkd5LT4FJNYnzQU= Sender: "yuzhao via sendgmr" X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:7220:84ff:fe09:2d90]) (user=yuzhao job=sendgmr) by 2002:a05:6214:1785:: with SMTP id ct5mr4855273qvb.26.1607379011448; Mon, 07 Dec 2020 14:10:11 -0800 (PST) Date: Mon, 7 Dec 2020 15:09:46 -0700 In-Reply-To: <20201207220949.830352-1-yuzhao@google.com> Message-Id: <20201207220949.830352-9-yuzhao@google.com> Mime-Version: 1.0 References: <20201207220949.830352-1-yuzhao@google.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH 08/11] mm: fold page_lru_base_type() into its sole caller From: Yu Zhao To: Andrew Morton , Hugh Dickins , Alex Shi Cc: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We've removed all other references to this function. Signed-off-by: Yu Zhao --- include/linux/mm_inline.h | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 6d907a4dd6ad..7183c7a03f09 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -45,21 +45,6 @@ static __always_inline void update_lru_size(struct lruvec *lruvec, #endif } -/** - * page_lru_base_type - which LRU list type should a page be on? - * @page: the page to test - * - * Used for LRU list index arithmetic. - * - * Returns the base LRU type - file or anon - @page should be on. - */ -static inline enum lru_list page_lru_base_type(struct page *page) -{ - if (page_is_file_lru(page)) - return LRU_INACTIVE_FILE; - return LRU_INACTIVE_ANON; -} - /** * __clear_page_lru_flags - clear page lru flags before releasing a page * @page: the page that was on lru and now has a zero reference @@ -92,12 +77,12 @@ static __always_inline enum lru_list page_lru(struct page *page) VM_BUG_ON_PAGE(PageActive(page) && PageUnevictable(page), page); if (PageUnevictable(page)) - lru = LRU_UNEVICTABLE; - else { - lru = page_lru_base_type(page); - if (PageActive(page)) - lru += LRU_ACTIVE; - } + return LRU_UNEVICTABLE; + + lru = page_is_file_lru(page) ? LRU_INACTIVE_FILE : LRU_INACTIVE_ANON; + if (PageActive(page)) + lru += LRU_ACTIVE; + return lru; } -- 2.29.2.576.ga3fc446d84-goog