From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbdAZJtE convert rfc822-to-8bit (ORCPT ); Thu, 26 Jan 2017 04:49:04 -0500 Received: from smtp-out6.electric.net ([192.162.217.187]:62525 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753200AbdAZJtB (ORCPT ); Thu, 26 Jan 2017 04:49:01 -0500 From: David Laight To: "'Daniel Borkmann'" , Michal Hocko CC: Alexei Starovoitov , Andrew Morton , Vlastimil Babka , Mel Gorman , Johannes Weiner , linux-mm , LKML , "netdev@vger.kernel.org" , "marcelo.leitner@gmail.com" Subject: RE: [PATCH 0/6 v3] kvmalloc Thread-Topic: [PATCH 0/6 v3] kvmalloc Thread-Index: AQHSd7fg4BbgIp0Hp0e1tlAqALzWNKFKgfKw Date: Thu, 26 Jan 2017 09:48:52 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB026EB24@AcuExch.aculab.com> References: <588907AA.1020704@iogearbox.net> <20170126074354.GB8456@dhcp22.suse.cz> <5889C331.7020101@iogearbox.net> In-Reply-To: <5889C331.7020101@iogearbox.net> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Borkmann > Sent: 26 January 2017 09:37 ... > >> I assume that kvzalloc() is still the same from [1], right? If so, then > >> it would unfortunately (partially) reintroduce the issue that was fixed. > >> If you look above at flags, they're also passed to __vmalloc() to not > >> trigger OOM in these situations I've experienced. > > > > Pushing __GFP_NORETRY to __vmalloc doesn't have the effect you might > > think it would. It can still trigger the OOM killer becauset the flags > > are no propagated all the way down to all allocations requests (e.g. > > page tables). This is the same reason why GFP_NOFS is not supported in > > vmalloc. > > Ok, good to know, is that somewhere clearly documented (like for the > case with kmalloc())? If not, could we do that for non-mm folks, or > at least add a similar WARN_ON_ONCE() as you did for kvmalloc() to make > it obvious to users that a given flag combination is not supported all > the way down? ISTM that requests for the relatively small memory blocks needed for page tables aren't really likely to invoke the OOM killer when it isn't already being invoked by other actions. So that isn't really a problem. More of a problem is that requests that you really don't mind failing can use the last 'reasonably available' memory. This will cause the next allocate to fail when it would be better for the earlier one to fail instead. David