From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152AbdASV2i (ORCPT ); Thu, 19 Jan 2017 16:28:38 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:2549 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbdASV2f (ORCPT ); Thu, 19 Jan 2017 16:28:35 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 19 Jan 2017 13:27:47 -0800 Subject: Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers To: Michal Hocko References: <20170116194052.GA9382@dhcp22.suse.cz> <1979f5e1-a335-65d8-8f9a-0aef17898ca1@nvidia.com> <20170116214822.GB9382@dhcp22.suse.cz> <20170117075100.GB19699@dhcp22.suse.cz> <20170118082146.GC7015@dhcp22.suse.cz> <37232cc6-af8b-52e2-3265-9ef0c0d26e5f@nvidia.com> <20170119084510.GF30786@dhcp22.suse.cz> <20170119095610.GL30786@dhcp22.suse.cz> CC: Andrew Morton , Vlastimil Babka , David Rientjes , Mel Gorman , Johannes Weiner , Al Viro , , LKML , Anatoly Stepanov , Paolo Bonzini , Mike Snitzer , "Michael S. Tsirkin" , "Theodore Ts'o" X-Nvconfidentiality: public From: John Hubbard Message-ID: Date: Thu, 19 Jan 2017 13:28:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170119095610.GL30786@dhcp22.suse.cz> X-Originating-IP: [172.17.160.221] X-ClientProxiedBy: HQMAIL102.nvidia.com (172.18.146.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/19/2017 01:56 AM, Michal Hocko wrote: > On Thu 19-01-17 01:09:35, John Hubbard wrote: > [...] >> So that leaves us with maybe this for documentation? >> >> * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be passed in. >> * Passing in __GFP_REPEAT is supported, and will cause the following behavior: >> * for larger (>64KB) allocations, the first part (kmalloc) will do some >> * retrying, before falling back to vmalloc. > > I am worried this is just too vague. It doesn't really help user to > decide whether "do some retrying" is what he really want's or needs. > > So I would rather see the following. > " > * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL are not supported. __GFP_REPEAT > * is supported only for large (>32kB) allocations and it should be used when using > * kmalloc is preferable because vmalloc fallback has visible performance drawbacks. > " > > I would also add > " > Any use of gfp flags outside of GFP_KERNEL should be consulted with mm people. > " > > Does it sound any better? Yes, that is good. I like that it helps guide the user. Here's some proposed optional grammar tweaks, but even without these, the above is understandable, so either way, I'm happy now: * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL are not supported. __GFP_REPEAT * is supported only for large (>32kB) allocations, and it should be used only if * kmalloc is preferable to the vmalloc fallback, due to visible performance drawbacks. * * Please consult with mm people before using any gfp flags other than GFP_KERNEL. thanks john h > -- > 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id 7FD1E6B02C4 for ; Thu, 19 Jan 2017 16:28:38 -0500 (EST) Received: by mail-pg0-f71.google.com with SMTP id z67so71787651pgb.0 for ; Thu, 19 Jan 2017 13:28:38 -0800 (PST) Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com. [216.228.121.65]) by mx.google.com with ESMTPS id m1si4635469plb.313.2017.01.19.13.28.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 13:28:37 -0800 (PST) Subject: Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers References: <20170116194052.GA9382@dhcp22.suse.cz> <1979f5e1-a335-65d8-8f9a-0aef17898ca1@nvidia.com> <20170116214822.GB9382@dhcp22.suse.cz> <20170117075100.GB19699@dhcp22.suse.cz> <20170118082146.GC7015@dhcp22.suse.cz> <37232cc6-af8b-52e2-3265-9ef0c0d26e5f@nvidia.com> <20170119084510.GF30786@dhcp22.suse.cz> <20170119095610.GL30786@dhcp22.suse.cz> From: John Hubbard Message-ID: Date: Thu, 19 Jan 2017 13:28:32 -0800 MIME-Version: 1.0 In-Reply-To: <20170119095610.GL30786@dhcp22.suse.cz> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , Vlastimil Babka , David Rientjes , Mel Gorman , Johannes Weiner , Al Viro , linux-mm@kvack.org, LKML , Anatoly Stepanov , Paolo Bonzini , Mike Snitzer , "Michael S. Tsirkin" , Theodore Ts'o On 01/19/2017 01:56 AM, Michal Hocko wrote: > On Thu 19-01-17 01:09:35, John Hubbard wrote: > [...] >> So that leaves us with maybe this for documentation? >> >> * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be passed in. >> * Passing in __GFP_REPEAT is supported, and will cause the following behavior: >> * for larger (>64KB) allocations, the first part (kmalloc) will do some >> * retrying, before falling back to vmalloc. > > I am worried this is just too vague. It doesn't really help user to > decide whether "do some retrying" is what he really want's or needs. > > So I would rather see the following. > " > * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL are not supported. __GFP_REPEAT > * is supported only for large (>32kB) allocations and it should be used when using > * kmalloc is preferable because vmalloc fallback has visible performance drawbacks. > " > > I would also add > " > Any use of gfp flags outside of GFP_KERNEL should be consulted with mm people. > " > > Does it sound any better? Yes, that is good. I like that it helps guide the user. Here's some proposed optional grammar tweaks, but even without these, the above is understandable, so either way, I'm happy now: * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL are not supported. __GFP_REPEAT * is supported only for large (>32kB) allocations, and it should be used only if * kmalloc is preferable to the vmalloc fallback, due to visible performance drawbacks. * * Please consult with mm people before using any gfp flags other than GFP_KERNEL. thanks john h > -- > 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 > -- 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