From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbdKBFuW (ORCPT ); Thu, 2 Nov 2017 01:50:22 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:38561 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752567AbdKBFuV (ORCPT ); Thu, 2 Nov 2017 01:50:21 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.220.163 X-Original-MAILFROM: minchan@kernel.org Date: Thu, 2 Nov 2017 14:50:19 +0900 From: Minchan Kim To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Tim Chen , Michal Hocko , stable@vger.kernel.org, Christian Kujau Subject: Re: [PATCH -mm -V3] mm, swap: Fix false error message in __swp_swapcount() Message-ID: <20171102055019.GA26929@bbox> References: <20171102054225.22897-1-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171102054225.22897-1-ying.huang@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2017 at 01:42:25PM +0800, Huang, Ying wrote: > From: Huang Ying > > When a page fault occurs for a swap entry, the physical swap readahead > (not the VMA base swap readahead) may readahead several swap entries > after the fault swap entry. The readahead algorithm calculates some > of the swap entries to readahead via increasing the offset of the > fault swap entry without checking whether they are beyond the end of > the swap device and it relys on the __swp_swapcount() and > swapcache_prepare() to check it. Although __swp_swapcount() checks > for the swap entry passed in, it will complain with the error message > as follow for the expected invalid swap entry. This may make the end > users confused. > > swap_info_get: Bad swap offset entry 0200f8a7 > > To fix the false error message, the swap entry checking is added in > swapin_readahead() to avoid to pass the out-of-bound swap entries and > the swap entry reserved for the swap header to __swp_swapcount() and > swapcache_prepare(). > > Cc: Tim Chen > Cc: Michal Hocko > Cc: # 4.11-4.13 > Fixes: e8c26ab60598 ("mm/swap: skip readahead for unreferenced swap slots") > Reported-by: Christian Kujau > Suggested-by: Minchan Kim > Signed-off-by: "Huang, Ying" Acked-by: Minchan Kim