From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH 02/18] mm: make vm_mmap killable Date: Fri, 11 Mar 2016 13:12:35 +0100 Message-ID: <20160311121235.GI27701@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-3-git-send-email-mhocko@kernel.org> <56E29702.5030100@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:33759 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbcCKMMi (ORCPT ); Fri, 11 Mar 2016 07:12:38 -0500 Content-Disposition: inline In-Reply-To: <56E29702.5030100@suse.cz> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vlastimil Babka Cc: LKML , Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , Christian =?iso-8859-1?Q?K=F6nig?= , Daniel Vetter , Dave Hansen , David Airlie , Davidlohr Bueso , David Rientjes , "H . Peter Anvin" , Hugh Dickins , Ingo Molnar , Johannes Weiner , "Kirill A . Shutemov" , Konstantin Khlebnikov , linux-arch@vger.kernel.org, Mel Gorman , Oleg Nesterov Pe On Fri 11-03-16 10:59:30, Vlastimil Babka wrote: > On 02/29/2016 02:26 PM, Michal Hocko wrote: > >From: Michal Hocko > > > >All the callers of vm_mmap seem to check for the failure already > >and bail out in one way or another on the error which means that > > Hmm I'm not that sure about this one: > 17 1071 fs/binfmt_elf.c <> > > Assigns result of vm_mmap() to "error" variable which is never checked. Yes it is not checked but not used either. If the current got killed then it wouldn't return to the userspace so my understanding is that not checking this value is not a problem. At least that is my understanding. > Shouldn't __must_check trigger here? well, __must_check is a misleading name. It doesn't actually enforce the value is checked. It just has to be used and an assignment is sufficient. I was discussing this without our gcc guy and he promissed to look and try to come up with a different attribute which would actually work like __must_check. -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:33759 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbcCKMMi (ORCPT ); Fri, 11 Mar 2016 07:12:38 -0500 Date: Fri, 11 Mar 2016 13:12:35 +0100 From: Michal Hocko Subject: Re: [PATCH 02/18] mm: make vm_mmap killable Message-ID: <20160311121235.GI27701@dhcp22.suse.cz> References: <1456752417-9626-1-git-send-email-mhocko@kernel.org> <1456752417-9626-3-git-send-email-mhocko@kernel.org> <56E29702.5030100@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E29702.5030100@suse.cz> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vlastimil Babka Cc: LKML , Andrew Morton , linux-mm@kvack.org, Alex Deucher , Alex Thorlton , Andrea Arcangeli , Andy Lutomirski , Benjamin LaHaise , Christian =?iso-8859-1?Q?K=F6nig?= , Daniel Vetter , Dave Hansen , David Airlie , Davidlohr Bueso , David Rientjes , "H . Peter Anvin" , Hugh Dickins , Ingo Molnar , Johannes Weiner , "Kirill A . Shutemov" , Konstantin Khlebnikov , linux-arch@vger.kernel.org, Mel Gorman , Oleg Nesterov , Peter Zijlstra , Petr Cermak , Thomas Gleixner , Al Viro Message-ID: <20160311121235.Pk3mzgsR0xJuOVfgSqOeuuGJg9lY08Rfxp7SM4L8bbE@z> On Fri 11-03-16 10:59:30, Vlastimil Babka wrote: > On 02/29/2016 02:26 PM, Michal Hocko wrote: > >From: Michal Hocko > > > >All the callers of vm_mmap seem to check for the failure already > >and bail out in one way or another on the error which means that > > Hmm I'm not that sure about this one: > 17 1071 fs/binfmt_elf.c <> > > Assigns result of vm_mmap() to "error" variable which is never checked. Yes it is not checked but not used either. If the current got killed then it wouldn't return to the userspace so my understanding is that not checking this value is not a problem. At least that is my understanding. > Shouldn't __must_check trigger here? well, __must_check is a misleading name. It doesn't actually enforce the value is checked. It just has to be used and an assignment is sufficient. I was discussing this without our gcc guy and he promissed to look and try to come up with a different attribute which would actually work like __must_check. -- Michal Hocko SUSE Labs