Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1496326rdb; Mon, 8 Jan 2024 00:29:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8tm2focqWL/ZYJ7ylhyfu/yj1ieHdjFyLVM6Wia1Yr9RjjA+IxtPVqP9n4HDWnQneFUkR X-Received: by 2002:a05:6a20:4a08:b0:199:c4d6:d7df with SMTP id fr8-20020a056a204a0800b00199c4d6d7dfmr202320pzb.82.1704702541463; Mon, 08 Jan 2024 00:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704702541; cv=none; d=google.com; s=arc-20160816; b=g4PQMPPqnsQ0MvaeM1zNCMXm/rhwW1L6CEIBCHfsq0LDRrKO2xXsV5TSniblXQnOMt IKNlR5VXveEJNkBs2kwZZtS6/WnkKrXUi8NbrvGaEuh4T7lHmvgMoe3oeP6lzToRCL9W dnxDhr895TNoUWQvElzJHr9ya3FJy94YA6nm4UHvhCUFxSzVD3q1DrqGfu6Sx6qMnt6r U3fMcN8XOYi3dcSceVFxzsAZGMEwEgorFJpTck3KSh2JLwepQmkD8tOzAr0hUhi4BJ4M /F2nsgg6jy7gkKJJ9aFr6R8bQTzURskDQ+i0QnaS7Mhy896SWuqRmhqLmxfij5tlzrCk joPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=LQ3QaRPFbj9TbUDkOZxRX+Fp7yii44Xfmpl2MpTVQyU=; fh=lglWh+bc/CyzhrEYAt4ODINAw8C0gMcuCzAa1q829uA=; b=cks1XZicBh4hwv9nR3DMmhmngEna6eO5DV+LN+fAU4RunRA4hkv6pRzyDwl+UUAD2+ LfcOA3Lx09foih5fEem6f1Hq3km7edJsLwHbd/laPn/IvPS+JFW3kk6EYm6fLOaYYuMt tO07EKPIwRxnXq7ziFGvCWsH9eBF13O7YF74/3LEC0sqi9ohkXq1tR/yVamP2cwTWWeS Y6okEwOxR+u3/wnQK+Yi26pR4+ZcREC6iFD2D4nMZGLKkuC7NSniwK0vKbJu1Tj4ytJC SqCgbRLZC/jERf7UR5mSq8SlYqLwKF12Uz24+MqOwLX2xK42uA97Vqnauj0rXTbUwrjs dpcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JrUqbAZj; spf=pass (google.com: domain of linux-kernel+bounces-19187-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id oa9-20020a17090b1bc900b002773d013d02si5386452pjb.140.2024.01.08.00.29.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 00:29:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19187-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JrUqbAZj; spf=pass (google.com: domain of linux-kernel+bounces-19187-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 23C71282593 for ; Mon, 8 Jan 2024 08:29:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66179BE49; Mon, 8 Jan 2024 08:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JrUqbAZj" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29B69B673 for ; Mon, 8 Jan 2024 08:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704702533; x=1736238533; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=prSPQ9PpceItCYT5PtbjU8y4+s795odvXDIRVVIUCcg=; b=JrUqbAZj3I5oCL8ZwNwjsaQrkmci2QqGb25VBv8J9hg6/l24Fk/q5pb7 17/yGQHH/e2X/E5GZ0cACxh0TPIz2gaaxBveRLEz+RdZleDIEJw0NFeJi cqPV9ZK86xYgFy9TOjNpfJVry7IY0z/EQvKSswbkNDldMuopIZD/N4oWy uN98ypMe6lnbZg5BN1c0sZXvkte28TYJXAbr2vTc+PzjerTn1/x0Zz5yo A3vYqwYrO+PYu31hR9Ok4rSfXm6H2h+P7qV4VuDA4wd+vD60wUaR7zYGz 6+8/GlXt4xCnwEq5PiBwDZQ2uITpaDysD8VSr0a2FcR22oC8TEQ/D6djq g==; X-IronPort-AV: E=McAfee;i="6600,9927,10946"; a="377967276" X-IronPort-AV: E=Sophos;i="6.04,340,1695711600"; d="scan'208";a="377967276" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2024 00:28:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10946"; a="924793054" X-IronPort-AV: E=Sophos;i="6.04,340,1695711600"; d="scan'208";a="924793054" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2024 00:28:49 -0800 From: "Huang, Ying" To: Kairui Song Cc: linux-mm@kvack.org, Kairui Song , Andrew Morton , Chris Li , Hugh Dickins , Johannes Weiner , Matthew Wilcox , Michal Hocko , Yosry Ahmed , David Hildenbrand , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 6/9] mm/swap: handle swapcache lookup in swapin_entry In-Reply-To: <20240102175338.62012-7-ryncsn@gmail.com> (Kairui Song's message of "Wed, 3 Jan 2024 01:53:35 +0800") References: <20240102175338.62012-1-ryncsn@gmail.com> <20240102175338.62012-7-ryncsn@gmail.com> Date: Mon, 08 Jan 2024 16:26:51 +0800 Message-ID: <87a5pg9qno.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Kairui Song writes: > From: Kairui Song > > Since all callers of swapin_entry need to check the swap cache first, we > can merge this common routine into swapin_entry, so it can be shared and > optimized later. > > Also introduce a enum to better represent possible swap cache usage, and > add some comments about it, make the usage of swap cache easier to > understand. I don't find any benefit to do this. The code line number isn't reduced. The concept of swap cache isn't hided either. -- Best Regards, Huang, Ying