Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp186629pxj; Wed, 26 May 2021 20:03:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB3w/QowLMMY19WT9Q/XT/r/SX6uCMZtkKJ0+MTCNEmy7Wj6bJoiLyRmPK5kdOqKtsMovM X-Received: by 2002:a17:906:6c8a:: with SMTP id s10mr1463815ejr.276.1622084624660; Wed, 26 May 2021 20:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622084624; cv=none; d=google.com; s=arc-20160816; b=u92k60UboRxr6So1tcxq373aWv5vshXEl8/vuxzJLZl0NGeuI9/+H1G7mZ6IC2ZlHQ BpG8uAOtqPfYEDRAxCDMDieoxddDKhIBWk/RSMYXTdIa5lAHEV4SJgH4bTAPajRCNb4r 5U5nTLVl7K0uhNwpRY/4cDq6gTC3OddnevjTONdps1Ue+npX8tIybCoMgprCHHnEFbct WGjCTLWzuJ1EZNqaIjNG3wfQlst8x1xXPmMMMAsBgoqKz9cu4u1FhBI8tCULhEouvZu5 lPmbbV+Ms/hbP4T9LDfLHwKKDLzvFNykHBKeRXmmaQoZ9ewNSFbtfyUIJ97u3eA3apoS d1Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2ZAwr+uWe1RDh6PrvXQCTvhQUq67NZKbIFSU2NmGCms=; b=ENG4/HTrz84HLlIWW4e5u4jURJ1wrY0OuNnQ8k6xhunPxiwUb/05Ruy5IGYidUqZV8 lqfZD23HjNf0XIWIcZ1mNAa1y/kiPMScQq8S/5eoM8/QJDZLGU1QGtfAB7F2Pw4WZsRA +UUtluNBSfAAS79qO5A2eubQ4FP3ehXvWaqhz+lJBkzbv5qyVD6GaL30IyDiFEN+donJ TY+EdjmMJ+COouOheNQp/bFaTR22VY4hWTtDKmHhwhfgrGpOjdMdCRTxzY0EaGn83AH0 krBMe2/T3ydLXQ4yQ4JtgxfHcgSsKqjcC7/lrJAgcOR8OrMgzLVhD2f3k4Imp0xF5x4/ 8RQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DInztS5v; 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 b15si917384edf.479.2021.05.26.20.03.21; Wed, 26 May 2021 20:03:44 -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=@google.com header.s=20161025 header.b=DInztS5v; 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 S234461AbhEZXFJ (ORCPT + 99 others); Wed, 26 May 2021 19:05:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234343AbhEZXFJ (ORCPT ); Wed, 26 May 2021 19:05:09 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D8E8C061574 for ; Wed, 26 May 2021 16:03:37 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id r5so5033895lfr.5 for ; Wed, 26 May 2021 16:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2ZAwr+uWe1RDh6PrvXQCTvhQUq67NZKbIFSU2NmGCms=; b=DInztS5vf5H0IuXW0bNB2j/bEcRgqdeBKI3unl909a7pWSL4CZS3Tpy3WBmmUC0gQY f68bgDCxLBTVFTAeX0sz7iharrOIYJSyiL9a4g2if77wv6Kt4MMDG5PxQWPy2jEvRogq JHf9kdJz1NqntFyp92Ws2ydglgYZOR2wRU1uEqQqVja7yEfpbEKpjNq093b4E1xcZR/l 3t8Ry09STINW1tp0ja6ia3P1FQ23E8rW2vntCvdsVevBk3LOb0+d26/1qDeV1Pfr9gQZ mFJZUPSR3GZpNKfvPFAoPmlR1k0qTLgF5nqRDSayzEjb4ePVni/0iGYbri7sNWNt+q8z e3jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2ZAwr+uWe1RDh6PrvXQCTvhQUq67NZKbIFSU2NmGCms=; b=lWU+z1BJ++3XQ6MhO/k1iwZLEPttoC24p1jlAilY5tickwPGzPk/xuDF8MvaOh8rxS rgVUiFVmumqhTXzql87ka5rBI5y1Y5ZpKIvJ1UWGpUas7Wk7YwzhgxQWeVPoXOGPBOf/ /3BIBj8hliv6kwMO5tqB+i7Lx4ZXOkASp5eYgRC+0CVXY4/Suw9KKXff6XWfIcbt/WF4 2b6afiKxKpUda0GbHO3/qVfuXXpdAQ8F14e2MIO3CbhwK9r0Atu0jl7HVrx9hRl5FrfF TtCsTDLke8ql8OPZuegsAlb+VenYw5T/X/jOj8+gil0Z3PGpZtWCnBm7kzN6MYPQR5ns yVOg== X-Gm-Message-State: AOAM530o3l4S+pcLLpN7KVjpr+iwJDu2oUHqfOStHBwd+15OHj7xQpWO kc5dGjpanYZBsZv4yGqmVMAuWtlhioJO+3mVzYtbEg== X-Received: by 2002:a19:7012:: with SMTP id h18mr285616lfc.432.1622070215096; Wed, 26 May 2021 16:03:35 -0700 (PDT) MIME-Version: 1.0 References: <20210526201239.3351-1-shy828301@gmail.com> <20210526201239.3351-2-shy828301@gmail.com> In-Reply-To: <20210526201239.3351-2-shy828301@gmail.com> From: Shakeel Butt Date: Wed, 26 May 2021 16:03:23 -0700 Message-ID: Subject: Re: [v4 PATCH 2/2] mm: rmap: make try_to_unmap() void function To: Yang Shi Cc: Hugh Dickins , Zi Yan , "Kirill A. Shutemov" , Minchan Kim , naoya.horiguchi@nec.com, wangyugui@e16-tech.com, Andrew Morton , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 26, 2021 at 1:12 PM Yang Shi wrote: > > Currently try_to_unmap() return bool value by checking page_mapcount(), > however this may return false positive since page_mapcount() doesn't > check all subpages of compound page. The total_mapcount() could be used > instead, but its cost is higher since it traverses all subpages. > > Actually the most callers of try_to_unmap() don't care about the > return value at all. So just need check if page is still mapped by > page_mapped() when necessary. And page_mapped() does bail out early > when it finds mapped subpage. > > Suggested-by: Hugh Dickins > Acked-by: Hugh Dickins > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt