Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbbGMKyp (ORCPT ); Mon, 13 Jul 2015 06:54:45 -0400 Received: from mga14.intel.com ([192.55.52.115]:32874 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555AbbGMKyT (ORCPT ); Mon, 13 Jul 2015 06:54:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,462,1432623600"; d="scan'208";a="763391666" From: "Kirill A. Shutemov" To: Andrew Morton , Oleg Nesterov Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Johannes Weiner , Michal Hocko Subject: [PATCH 5/5] mm, memcontrol: use vma_is_anonymous() to check for anon VMA Date: Mon, 13 Jul 2015 13:54:12 +0300 Message-Id: <1436784852-144369-6-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436784852-144369-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1436784852-144369-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1028 Lines: 31 !vma->vm_file is not reliable to detect anon VMA, because not all drivers bother set it. Let's use vma_is_anonymous() instead. Signed-off-by: Kirill A. Shutemov Cc: Johannes Weiner Cc: Michal Hocko --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index acb93c554f6e..a624709f0dd7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4809,7 +4809,7 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, struct address_space *mapping; pgoff_t pgoff; - if (!vma->vm_file) /* anonymous vma */ + if (vma_is_anonymous(vma)) /* anonymous vma */ return NULL; if (!(mc.flags & MOVE_FILE)) return NULL; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/