From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbdKEITu (ORCPT ); Sun, 5 Nov 2017 03:19:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:57759 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbdKEITt (ORCPT ); Sun, 5 Nov 2017 03:19:49 -0500 Date: Sun, 5 Nov 2017 09:19:46 +0100 From: Michal Hocko To: Bart Van Assche Cc: "yang.s@alibaba-inc.com" , "akpm@linux-foundation.org" , "joe@perches.com" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "mingo@redhat.com" , Peter Zijlstra Subject: Re: [PATCH] mm: use in_atomic() in print_vma_addr() Message-ID: <20171105081946.yr2pvalbegxygcky@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1509739786.2473.33.camel@wdc.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [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. -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 350E46B0069 for ; Sun, 5 Nov 2017 03:19:51 -0500 (EST) Received: by mail-pf0-f197.google.com with SMTP id g75so7573733pfg.4 for ; Sun, 05 Nov 2017 01:19:51 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id v68si10444758pfj.359.2017.11.05.01.19.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 05 Nov 2017 01:19:49 -0700 (PDT) Date: Sun, 5 Nov 2017 09:19:46 +0100 From: Michal Hocko Subject: Re: [PATCH] mm: use in_atomic() in print_vma_addr() Message-ID: <20171105081946.yr2pvalbegxygcky@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1509739786.2473.33.camel@wdc.com> Sender: owner-linux-mm@kvack.org List-ID: To: Bart Van Assche Cc: "yang.s@alibaba-inc.com" , "akpm@linux-foundation.org" , "joe@perches.com" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "mingo@redhat.com" , Peter Zijlstra [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. -- Michal Hocko SUSE Labs -- 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