From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbdJXURU (ORCPT ); Tue, 24 Oct 2017 16:17:20 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:54261 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897AbdJXURS (ORCPT ); Tue, 24 Oct 2017 16:17:18 -0400 X-Google-Smtp-Source: ABhQp+RBuNxAVjEYojZCwmpe/tWG5wJ7IOaQHeBC32Py/wk9h58w/hJEAfIeFHDGQHnGe0F/p+HQBg== Date: Wed, 25 Oct 2017 05:17:08 +0900 From: Minchan Kim To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Tim Chen , Michal Hocko , stable@vger.kernel.org, Christian Kujau Subject: Re: [PATCH -mm] mm, swap: Fix false error message in __swp_swapcount() Message-ID: <20171024201708.GA25022@bgram> References: <20171024024700.23679-1-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171024024700.23679-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 Tue, Oct 24, 2017 at 10:47:00AM +0800, Huang, Ying wrote: > From: Ying Huang > > __swp_swapcount() is used in __read_swap_cache_async(). Where the > invalid swap entry (offset > max) may be supplied during swap > readahead. But __swp_swapcount() will print error message for these > expected invalid swap entry as below, which will make the users > confusing. > > swap_info_get: Bad swap offset entry 0200f8a7 > > So the swap entry checking code in __swp_swapcount() is changed to > avoid printing error message for it. To avoid to duplicate code with > __swap_duplicate(), a new helper function named > __swap_info_get_silence() is added and invoked in both places. It's the problem caused by readahead, not __swap_info_get which is low-end primitive function. Instead, please fix high-end swapin_readahead to limit to last valid block as handling to avoid swap header which is special case, too.