From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbdKFKGV (ORCPT ); Mon, 6 Nov 2017 05:06:21 -0500 Received: from merlin.infradead.org ([205.233.59.134]:41976 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752161AbdKFKGS (ORCPT ); Mon, 6 Nov 2017 05:06:18 -0500 Date: Mon, 6 Nov 2017 11:05:58 +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: <20171106100558.GD3165@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171105081946.yr2pvalbegxygcky@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 Sun, Nov 05, 2017 at 09:19:46AM +0100, Michal Hocko wrote: > [CC Peter] > > On Fri 03-11-17 20:09:49, Bart Van Assche wrote: > > On Fri, 2017-11-03 at 11:02 -0700, Andrew Morton wrote: > > > Also, checkpatch says > > > > > > WARNING: use of in_atomic() is incorrect outside core kernel code > > > #43: FILE: mm/memory.c:4491: > > > + if (in_atomic()) > > > > > > I don't recall why we did that, but perhaps this should be revisited? > > > > Is the comment above in_atomic() still up-to-date? From : > > > > /* > > * Are we running in atomic context? WARNING: this macro cannot > > * always detect atomic context; in particular, it cannot know about > > * held spinlocks in non-preemptible kernels. Thus it should not be > > * used in the general case to determine whether sleeping is possible. > > * Do not use in_atomic() in driver code. > > */ > > #define in_atomic() (preempt_count() != 0) > > I can still see preempt_disable NOOP for !CONFIG_PREEMPT_COUNT kernels > which makes me think this is still a valid comment. Yes the comment is very much accurate. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id 2DFD56B026C for ; Mon, 6 Nov 2017 05:06:17 -0500 (EST) Received: by mail-io0-f200.google.com with SMTP id q81so21073009ioi.12 for ; Mon, 06 Nov 2017 02:06:17 -0800 (PST) Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id y74si7637945itc.72.2017.11.06.02.06.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 02:06:14 -0800 (PST) Date: Mon, 6 Nov 2017 11:05:58 +0100 From: Peter Zijlstra Subject: Re: [PATCH] mm: use in_atomic() in print_vma_addr() Message-ID: <20171106100558.GD3165@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171105081946.yr2pvalbegxygcky@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 Sun, Nov 05, 2017 at 09:19:46AM +0100, Michal Hocko wrote: > [CC Peter] > > On Fri 03-11-17 20:09:49, Bart Van Assche wrote: > > On Fri, 2017-11-03 at 11:02 -0700, Andrew Morton wrote: > > > Also, checkpatch says > > > > > > WARNING: use of in_atomic() is incorrect outside core kernel code > > > #43: FILE: mm/memory.c:4491: > > > + if (in_atomic()) > > > > > > I don't recall why we did that, but perhaps this should be revisited? > > > > Is the comment above in_atomic() still up-to-date? From : > > > > /* > > * Are we running in atomic context? WARNING: this macro cannot > > * always detect atomic context; in particular, it cannot know about > > * held spinlocks in non-preemptible kernels. Thus it should not be > > * used in the general case to determine whether sleeping is possible. > > * Do not use in_atomic() in driver code. > > */ > > #define in_atomic() (preempt_count() != 0) > > I can still see preempt_disable NOOP for !CONFIG_PREEMPT_COUNT kernels > which makes me think this is still a valid comment. Yes the comment is very much accurate. -- 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