From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755188AbcBBNVr (ORCPT ); Tue, 2 Feb 2016 08:21:47 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33398 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754922AbcBBNVq (ORCPT ); Tue, 2 Feb 2016 08:21:46 -0500 Date: Tue, 2 Feb 2016 14:21:44 +0100 From: Michal Hocko To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , Andrew Morton , Dmitry Vyukov , Vlastimil Babka , David Rientjes , Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm: fix bogus VM_BUG_ON_PAGE() in isolate_lru_page() Message-ID: <20160202132143.GH19910@dhcp22.suse.cz> References: <1454333169-121369-1-git-send-email-kirill.shutemov@linux.intel.com> <1454333169-121369-2-git-send-email-kirill.shutemov@linux.intel.com> <20160201142446.GB24008@dhcp22.suse.cz> <20160201143853.GA30090@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201143853.GA30090@node.shutemov.name> 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 Mon 01-02-16 16:38:53, Kirill A. Shutemov wrote: > On Mon, Feb 01, 2016 at 03:24:46PM +0100, Michal Hocko wrote: > > On Mon 01-02-16 16:26:08, Kirill A. Shutemov wrote: > > > We don't care if there's a tail pages which is not on LRU. We are not > > > going to isolate them anyway. > > > > yes we are not going to isolate them but calling this function on a > > tail page is wrong in principle, no? PageLRU check is racy outside of > > lru_lock so what if we are racing here. I know, highly unlikely but not > > impossible. So I am not really sure this is an improvement. When would > > we hit this VM_BUG_ON and it wouldn't be a bug or at least suspicious > > usage? > > Yes, there is no point in calling isolate_lru_page() for tail pages, but > we do this anyway -- see the second patch. yes, I have seen it and that is a bug as well AFAIU. So the VM_BUG_ON triggered for the real bug. > And we need to validate all drivers, that they don't forget to set VM_IO > or make vma_migratable() return false in other way. Yes, some drivers will do it incorrectly but this is VM_BUG_ON so it is usually disabled no? > Alternative approach would be to downgrate the VM_BUG_ON_PAGE() to > WARN_ONCE_ON(). This way we would have chance to catch bad callers. a ratelimitted WARN_ON would work as well. -- Michal Hocko SUSE Labs