From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681AbdKFMAf (ORCPT ); Mon, 6 Nov 2017 07:00:35 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:33237 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbdKFMAe (ORCPT ); Mon, 6 Nov 2017 07:00:34 -0500 Date: Mon, 6 Nov 2017 13:00:25 +0100 From: Peter Zijlstra To: Michal Hocko Cc: Bart Van Assche , "yang.s@alibaba-inc.com" , "akpm@linux-foundation.org" , "joe@perches.com" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "mingo@redhat.com" Subject: Re: [PATCH] mm: use in_atomic() in print_vma_addr() Message-ID: <20171106120025.GH3165@worktop.lehotels.local> References: <1509572313-102989-1-git-send-email-yang.s@alibaba-inc.com> <20171102075744.whhxjmqbdkfaxghd@dhcp22.suse.cz> <20171103110245.7049460a05cc18c7e8a9feb2@linux-foundation.org> <1509739786.2473.33.camel@wdc.com> <20171105081946.yr2pvalbegxygcky@dhcp22.suse.cz> <20171106100558.GD3165@worktop.lehotels.local> <20171106104354.2jlgd2m4j4gxx4qo@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171106104354.2jlgd2m4j4gxx4qo@dhcp22.suse.cz> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 06, 2017 at 11:43:54AM +0100, Michal Hocko wrote: > > Yes the comment is very much accurate. > > Which suggests that print_vma_addr might be problematic, right? > Shouldn't we do trylock on mmap_sem instead? Yes that's complete rubbish. trylock will get spurious failures to print when the lock is contended. The right solution is to not call this thing when you can't schedule, trying to divine the state in the print function is doomed to failure.