Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4531053pxk; Wed, 30 Sep 2020 05:33:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuuqihpXm/G/udBKxQOzYqkjRxMv8Y4WvbdVtBePqcR7ubGQ2VCNAgn2IdZA+Jqpa2Ldzb X-Received: by 2002:a05:6402:6d6:: with SMTP id n22mr2415296edy.79.1601469213624; Wed, 30 Sep 2020 05:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601469213; cv=none; d=google.com; s=arc-20160816; b=1ANRUha/n6e9w6z5QvqpNKmWk9wxGIzEKQcShDuT6Jus3dslMNWZdvDpre7VbxWYEx twzgRRWfC9amp4UENXLvjKXLqIXnRendbWUw7z3RkHSz9nfSf9La535QmViNycBDvnWB PWYwAruqJvs+VJ1VIS3nedEj7rV0xJ2QP7/23xRadMEed8mC/ggVhGXqXMF8gGyGzhz7 qMZDmBfuYFuwLz+n8EfBmF4MV8tLiepxubqNkomTxgY55Po49Yjtw8+jh9jX6gvmIdmO ke3JSDSaIljA+L+fZF32vxQYt1EmPXs+oi1eoXN7yqL8YYc7byljNisY0Rl/eFuBVYmW V3Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=j9/oKsXJpZXyeQKTaev3w4RNfmHS79ATahAgjioXXp8=; b=Nq7v9I5TQn7ee6DaJsa842TDvCQyO+FWvQo4g5CLUUtEccRArMuocIBZkjEGl+b2pE aDAwk07hilPcOGMmJKxu0RAviQdrNwgMAddSZefBUlmv7f506HZVq7WSnHC91vY+D5M5 uaDOOuSIEkw3Ej8SVqJt1j8NEPUSHWNALFMb+dZ1jvDkbfACXofHyDw+zjlWZmQFNnV2 IX+gETtU8eyso4Yz3ZTw09jWAu8+FbwOwfhCit6EkcL8h+rhJjM5d0zIPKP4QgdaWCal UHRoQg2la1EmKA4HDIJeuoZiLSjEoNpDG8jwEeGHlkoIzkyMNfX9QHOOIfHH7liJiMNb 40Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hnfGmHDR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si885207edw.458.2020.09.30.05.33.10; Wed, 30 Sep 2020 05:33:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hnfGmHDR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728340AbgI3Mb6 (ORCPT + 99 others); Wed, 30 Sep 2020 08:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbgI3Mb6 (ORCPT ); Wed, 30 Sep 2020 08:31:58 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03737C061755; Wed, 30 Sep 2020 05:31:58 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id 77so1941878lfj.0; Wed, 30 Sep 2020 05:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=j9/oKsXJpZXyeQKTaev3w4RNfmHS79ATahAgjioXXp8=; b=hnfGmHDRjYYcWgcCiPre31p22gIiWSjZ0GHw3fhfe/80Osu8GClQ20Qq/ITsw9UViy HBAyJJkvH2MEWJdV4+k3QiaIUicORMhBuo4QcMpRSlQMej9KJ9xc7WhtDRr1U5aY/SRo jxQ+IlSNiZ8GNSfXfrFCBqQKLoxUxNfGc8taXyfs5JcdVbosSplkw+uizOMRV1fJNq8d gshFllAdOsumUJa37H28NvTFx64B9sXm9LNwdUE+yAN7UZVq3+ZxC/n8yvG3R0bu0wjJ sLiuWDExobjIw45d5myMBkG0M7XJzb4wEkF9dvsNgeFEhy83qcpikSw9qkfBmdmSqyEn H8Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=j9/oKsXJpZXyeQKTaev3w4RNfmHS79ATahAgjioXXp8=; b=kyoy5c6Wf2a86h9kFaMw1gy4w5o9e5lyP3f28NjlD0dcj/ZePq1klYqj5vrcOLlpsB 2DuJimKjklxKJZa4d207GLRzzdX9wv5LMr+j1ON9k7BrzB8DzTylAliYFIBtYqPA2EZX lal+luTva/VwjkQPukZwf01JH6nY+TbBlSUfL31YtJ/jpX7TSryDOv/0N74Ac8ASmhin e+pdjjXdy9e13GqRHYiOhnP7aH0SGYDWp+wHdrx+qIcaM9IZNWlOG4bmGDsdJtdbsOD7 YcbIpzoqS+N7GYe4oXGZLl0fEqakuRT3nkhmLXS9DhaqbNvdXlkXaWJ7+sqeOaf9lLVq 0dtA== X-Gm-Message-State: AOAM532ulEOuQFj7Cjp10zZLF66Ztuet3NbeKtZPHiY8JYmARyWzcghv BSUa+ZK8b2vP+5Vgs2Oh8tQ= X-Received: by 2002:a19:640b:: with SMTP id y11mr755623lfb.373.1601469116418; Wed, 30 Sep 2020 05:31:56 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id l4sm176231lfg.296.2020.09.30.05.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 05:31:55 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 30 Sep 2020 14:31:53 +0200 To: Michal Hocko , "Paul E. McKenney" Cc: "Paul E. McKenney" , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, mgorman@techsingularity.net, torvalds@linux-foundation.org, "Uladzislau Rezki (Sony)" Subject: Re: [PATCH tip/core/rcu 14/15] rcu/tree: Allocate a page when caller is preemptible Message-ID: <20200930123153.GA18005@pc636> References: <20200928233041.GA23230@paulmck-ThinkPad-P72> <20200928233102.24265-14-paulmck@kernel.org> <20200929120756.GC2277@dhcp22.suse.cz> <20200930015327.GX29330@paulmck-ThinkPad-P72> <20200930084139.GN2277@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200930084139.GN2277@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > What is the point of calling kmalloc for a PAGE_SIZE object? Wouldn't > > > using the page allocator directly be better? > > > > Well, you guys gave me considerable heat about abusing internal allocator > > interfaces, and kmalloc() and kfree() seem to be about as non-internal > > as you can get and still be invoking the allocator. ;-) > > alloc_pages resp. __get_free_pages is a normal page allocator interface > to use for page size granular allocations. kmalloc is for more fine > grained allocations. > I do not have a strong opinion here but i would tend to using of the page allocator directly. Because we operate on a page level where the page allocator is supposed to be used. From the other hand i saw a slightly better performance in case of SLAB only. I think that is because of a) slab caches; b) more objects which can be cached. But i have one more concern about using of kmalloc(). That is about fragmentations it can cause with PAGE_SIZE requests. As for SLUB it was identical whereas the SLOB i din not check. -- Vlad Rezki