From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754271AbdCaIq7 (ORCPT ); Fri, 31 Mar 2017 04:46:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:41436 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbdCaIqz (ORCPT ); Fri, 31 Mar 2017 04:46:55 -0400 Date: Fri, 31 Mar 2017 10:46:53 +0200 From: Michal Hocko To: Shakeel Butt Cc: Andrew Morton , Linux MM , LKML , Eric Dumazet , Vlastimil Babka Subject: Re: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open coded variant Message-ID: <20170331084652.GL27098@dhcp22.suse.cz> References: <20170306103032.2540-1-mhocko@kernel.org> <20170306103327.2766-1-mhocko@kernel.org> <20170306103327.2766-3-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 30-03-17 16:21:43, Shakeel Butt wrote: > On Mon, Mar 6, 2017 at 2:33 AM, Michal Hocko wrote: > > From: Michal Hocko > > > > fq_alloc_node, alloc_netdev_mqs and netif_alloc* open code kmalloc > > with vmalloc fallback. Use the kvmalloc variant instead. Keep the > > __GFP_REPEAT flag based on explanation from Eric: > > " > > At the time, tests on the hardware I had in my labs showed that > > vmalloc() could deliver pages spread all over the memory and that was a > > small penalty (once memory is fragmented enough, not at boot time) > > " > > > > The way how the code is constructed means, however, that we prefer to go > > and hit the OOM killer before we fall back to the vmalloc for requests > > <=32kB (with 4kB pages) in the current code. This is rather disruptive for > > something that can be achived with the fallback. On the other hand > > __GFP_REPEAT doesn't have any useful semantic for these requests. So the > > effect of this patch is that requests smaller than 64kB will fallback to > > I am a bit confused about this 64kB, shouldn't it be <=32kB (with 4kB > pages & PAGE_ALLOC_COSTLY_ORDER = 3)? You are right. I just forgot to update wording. "mm: support __GFP_REPEAT in kvmalloc_node for >32kB" was fixed but this one stayed in place. s@smaller than 64kB@which fit into 32kB@ Andrew could you update the changelog please? -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id 991796B0038 for ; Fri, 31 Mar 2017 04:46:56 -0400 (EDT) Received: by mail-wr0-f199.google.com with SMTP id l95so14857257wrc.12 for ; Fri, 31 Mar 2017 01:46:56 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id 136si2512408wmw.28.2017.03.31.01.46.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 31 Mar 2017 01:46:55 -0700 (PDT) Date: Fri, 31 Mar 2017 10:46:53 +0200 From: Michal Hocko Subject: Re: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open coded variant Message-ID: <20170331084652.GL27098@dhcp22.suse.cz> References: <20170306103032.2540-1-mhocko@kernel.org> <20170306103327.2766-1-mhocko@kernel.org> <20170306103327.2766-3-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Shakeel Butt Cc: Andrew Morton , Linux MM , LKML , Eric Dumazet , Vlastimil Babka On Thu 30-03-17 16:21:43, Shakeel Butt wrote: > On Mon, Mar 6, 2017 at 2:33 AM, Michal Hocko wrote: > > From: Michal Hocko > > > > fq_alloc_node, alloc_netdev_mqs and netif_alloc* open code kmalloc > > with vmalloc fallback. Use the kvmalloc variant instead. Keep the > > __GFP_REPEAT flag based on explanation from Eric: > > " > > At the time, tests on the hardware I had in my labs showed that > > vmalloc() could deliver pages spread all over the memory and that was a > > small penalty (once memory is fragmented enough, not at boot time) > > " > > > > The way how the code is constructed means, however, that we prefer to go > > and hit the OOM killer before we fall back to the vmalloc for requests > > <=32kB (with 4kB pages) in the current code. This is rather disruptive for > > something that can be achived with the fallback. On the other hand > > __GFP_REPEAT doesn't have any useful semantic for these requests. So the > > effect of this patch is that requests smaller than 64kB will fallback to > > I am a bit confused about this 64kB, shouldn't it be <=32kB (with 4kB > pages & PAGE_ALLOC_COSTLY_ORDER = 3)? You are right. I just forgot to update wording. "mm: support __GFP_REPEAT in kvmalloc_node for >32kB" was fixed but this one stayed in place. s@smaller than 64kB@which fit into 32kB@ Andrew could you update the changelog please? -- 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