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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 1CFDF6B0261 for ; Mon, 6 Nov 2017 07:00:32 -0500 (EST) Received: by mail-pg0-f70.google.com with SMTP id r25so12481079pgn.23 for ; Mon, 06 Nov 2017 04:00:32 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id s8si10884886pgp.374.2017.11.06.04.00.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 04:00:31 -0800 (PST) Date: Mon, 6 Nov 2017 13:00:25 +0100 From: Peter Zijlstra 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> Sender: owner-linux-mm@kvack.org List-ID: 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" 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. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org