Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp294552lqh; Fri, 31 May 2024 01:13:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvFRml3cX4UnjSO9kqIR54sFxdLNoLEBlkG1mRIxrdZ3j9fbFEsh6b9uZGUCq4ZVi/KAWZp0vDkmXGzxsAWQ9I9W5sUyLDGIhfp1qXVA== X-Google-Smtp-Source: AGHT+IGv+106p/zqTKfgepQT83r7hSIFcK10AVnqpu/HqOpnGc+Ue0F//86OGbroLUW2wTOiwhLH X-Received: by 2002:a0c:cb11:0:b0:6ae:3dde:7475 with SMTP id 6a1803df08f44-6aecd6da661mr10850846d6.42.1717143207334; Fri, 31 May 2024 01:13:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717143206; cv=pass; d=google.com; s=arc-20160816; b=ioSlVZZk5hsK/Zk5z+V1S1eSd0Ws124K36QloxtJcHeKSL4g7n9eMROYvyaRhuh6xt yRxJz6Erot/sR/mXW01F4ITzhud/6/MDKFMOfdc6SOXgFx26rhjsJqd23QvaNuha0Y29 F0ZaSGeDTeR2VlwVANSWOGzwLw6IJ+ZoPnwQWn5pDPYAIcSbn1YnR4Mfkz/NZQo8aGH5 3USUzPibj5wlY1oAiHUaH7W6nmHi/mF9jLn5cqPulJds01xBpujCjYdGe0eN0HIi4VLn xJhOk9NKFuVp0vyKeUhRRdzLvEit+l/YtkjWW32ycwS12mNmMObdywaGl+P0HDzZvB2P fGnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=PPwrYAIZ5zTOlCJr6Ho4lNo3rSzJxAxHic9x6bIOlds=; fh=DHOJWTEg3cgqV/EiQQcNfxw3x3AovUe/fRe0vYBPHqk=; b=JFr74aPNJNaHmn5cahh4F6k6KijgoEZtPi8IA9/eqhPSEWreleyCvIJ3soolI+mm2a AdPzJITwhl1EqmTy5ez/9tmo0kGLksDor4y8KGO29YlJ/pLTwuhPjqcgeieelv2dpU8Y a1PMjrbPUqamB3q3LQOQxrZ+ZtwcEnv5AD5CtV4LtwsiZbXhq3/E5ZmtvPFzLo1wQ+3u pb5m3LmeY19Wb8rdhUt6f1NfD8F/rtNb5/+piM0oRDgpn7+sBXCPOu3OnIBQYvM00TUo bNIFrBFxcoemPg6bY7C3+JBYZQAjBzJVzmjyWygbIH5SYiJ5dd7hzym3ZeKcbg7B14yF +Fpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IGy07DBt; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-196447-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196447-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4a741b0csi15219836d6.128.2024.05.31.01.13.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 01:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196447-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IGy07DBt; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-196447-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196447-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1B0461C2159C for ; Fri, 31 May 2024 08:13:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0FDF78B4C; Fri, 31 May 2024 08:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IGy07DBt" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 15D3315E89 for ; Fri, 31 May 2024 08:12:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717143176; cv=none; b=qkYQtbqOan7ZHOk5HsSy7E8eRg1Zo8XahoGMNmsDQ118DuIpSBoukTrBQlhPn6XAphB+oqrusYs/UxyKZ/gYEEjYwfrjTBqrDGYtfVf9HaCX3IklPlEvb6qfrvGA73gYkCOVILhKhobj485KX+2mDCCNpegYo2EQNKegCgNd6lE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717143176; c=relaxed/simple; bh=+HL84eWGAxnOcQGlr/4MbeLb2An0y1RSJRklCBfMaL8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=hDwYyiFfvHjOdgmI1Pji7ratflSxKTYtycgdIuufTiWlyhAVIAF3ytDZl7r7/KM0CLlxSr5IoQ+mx/VMyoAq61qAL1D+sS5NcdrqkzNC9WwozdLm2BaNMZELGOf378A+7zoN/iHPJKOMjYI5LyjqYGlqe8WaXFKnNVvnsm+5PQE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IGy07DBt; arc=none smtp.client-ip=192.198.163.10 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=1717143175; x=1748679175; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+HL84eWGAxnOcQGlr/4MbeLb2An0y1RSJRklCBfMaL8=; b=IGy07DBtlj6Z2l6N/9Ea3fjkSqnc2aRLUqBlL6Tv+pbRYaweU4GVINjq A3yoJ9AkhizxIBhnb1K9pdSW7mXZSgGY0lRTX9u1G3OfaIbw5h5ov2zHr X1odU1Q1bb4Ksx72cuIuEPstJZxjQ13I2gYRnLrAxGjaUB8MnmlZDfM6t nTfQSnjHZDzEynlQOpbh35YFoyRorVa8mT54C2WdoM3ZK45nmICdA5QFu 0SR9RxzqWVrY1Q2OQi1A5J10OIQas7InkElq/CiG3MawEFRepeibEorAP KSWHsoYui1Xdv63/NXSv0GrWPkW4TdXzhmjqbKotQwsBycGWn1gYExvdk g==; X-CSE-ConnectionGUID: tYW88OJXRmGAqLcbkzV89w== X-CSE-MsgGUID: lBXf4L2rSjaYJGcAZFoGaw== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="25079730" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="25079730" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:12:54 -0700 X-CSE-ConnectionGUID: GDugZUomRcCClg2XooWNuA== X-CSE-MsgGUID: r3kK+LwIRb+g4NR6Ws7B1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="59270914" Received: from unknown (HELO yhuang6-mobl2.ccr.corp.intel.com) ([10.255.30.35]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:12:50 -0700 From: Huang Ying To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Huang Ying" , Hugh Dickins , Alistair Popple , Anshuman Khandual , David Hildenbrand , Mel Gorman , Miaohe Lin , Minchan Kim , Ryan Roberts , Yang Shi , Yu Zhao , Kairui Song , Barry Song , Chris Li , Yosry Ahmed Subject: [PATCH 0/3] mm,swap: cleanup VMA based swap readahead window calculation Date: Fri, 31 May 2024 16:12:27 +0800 Message-Id: <20240531081230.310128-1-ying.huang@intel.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Huang Ying" When VMA based swap readahead is introduced in commit ec560175c0b6 ("mm, swap: VMA based swap readahead"), "struct vma_swap_readahead" is defined to describe the readahead window. Because we wanted to save the PTE entries in the struct at that time. But after commit 4f8fcf4ced0b ("mm/swap: swap_vma_readahead() do the pte_offset_map()"), we no longer save PTE entries in the struct. The size of the struct becomes so small, that it's better to use the fields of the struct directly. This can simplify the code to improve the code readability. The line number of source code reduces too. A theoretical underflow issue and some related code cleanup is done in the series too. Best Regards, Huang, Ying