Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8086853ybl; Thu, 16 Jan 2020 10:22:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzv4Gnfuwl6nzS8R5kCViC/iSS9Z3qC/z7Y0lULfTMxCWrVFpY64/g/rXat+kaIpzIuypNk X-Received: by 2002:a9d:6196:: with SMTP id g22mr3238738otk.204.1579198968181; Thu, 16 Jan 2020 10:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579198968; cv=none; d=google.com; s=arc-20160816; b=mH1SGCdPb5OeCExk7G911Lvt1gsdEt+uM32tENLDWMyCpqepi875msJgR0OO/lxIiS s48uzUKTcQEVG2+BP5JXiLW1yR735YpOTMiRk/JPVuEtLU0GvfJ/XlqlgFY3zAqS/2or pYhiltKzyjTnu6cJI+BGndJmVVO2gPYZVWo9LGghl+OT2hIuzbuAGVOn9N+7HgZ9IbYI 80ac3MxtS2zV8d54/77NLXsshH17czYS3Mgm8T6hMPEehL18d8op0lnANYZ9pp62OmJX zmMpXlTz4xRbVqwq7EVoT/RCE9X47tCp/LH1GiXH+OT1BhKpdocnFY65zUChNEYbWd2o l1rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=KAfEq0Wia/8z+S4bm8ISIAkLRoETrLhDzNF3CD6LfUo=; b=K/MBgKx0ud95R6vu5czKKNy21GNWZ+GG7Qs/M/+nWrqDzPU6HmQs60OH3ilmvzkFcY 9u1+1+/0ha6diV7UFEHy99fN1uNn8TkbXA8dAEvFccHw7NFkQP1MhELc/TdGtb5zDCJg pqUMP+l36aPFlDaE3pHR/H9/ORah6QOcwpFEVAFFpMpX3ueuvXWqXW87jEllIEU5fKdb Oub6+RQ7Q9N7f5tcjusDD4bDfp2zydcQH5VLVeoAuN8Ucl2qZlugg92m5RYgfYpD7oGp uNgQ0PLe3O+mrMmkmMn1LoBerQ/jCVzOIKtqmKnNe0omohRrvYB3XUUrThzVVOq4nUpt GLIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CC0D61/l"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id o16si13919800otp.289.2020.01.16.10.22.36; Thu, 16 Jan 2020 10:22:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CC0D61/l"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2404226AbgAPSVD (ORCPT + 99 others); Thu, 16 Jan 2020 13:21:03 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:44933 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392514AbgAPR15 (ORCPT ); Thu, 16 Jan 2020 12:27:57 -0500 Received: by mail-lj1-f196.google.com with SMTP id u71so23522436lje.11; Thu, 16 Jan 2020 09:27:56 -0800 (PST) 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=KAfEq0Wia/8z+S4bm8ISIAkLRoETrLhDzNF3CD6LfUo=; b=CC0D61/ly4pXDeN66+tjpJvQRw+us91gGWNkXwaMXhXuk921z3PBxraiZLMjF1Lnuw IJNmch97bvt3ZuFpG0uSWWF0iu9WHRpYjrQFyYuxnzKXxBNM9b5WUa9KbQyPE93RYjsH Gy09E//nokyfyE0pzw0qdZvKQAHp+2Jbq9yy5Mtcsd5Q80cKvtIldbVKIv2WAJL2sJN0 3f8Vc4bV6cbNFRTaFQh9FF6zuxV8lN0ahTI0ohvHyq58FYwBsNI9MQtrka9UX8OE3IMc BSZlKeXIU3LwyaKDhNhTTbs9I2Y06tGmUeki0TD7kOitLJlJLhfdcPX26NqpzwId3HDn Jp2w== 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=KAfEq0Wia/8z+S4bm8ISIAkLRoETrLhDzNF3CD6LfUo=; b=VwDIRjUyD5TttKtMAdJDMQniiPDkeHGWStnDtzLoqi/X5OWMaVFlp7xzfnrWTtvHn/ 2d00CjW2FG2VSHWMWJU2ZLSeIcqH1gUQHE4ZFBzXDJztqK515s2cIDh8hSOJrv6wP1uW FjFdX/85YdOvtl/BHXkOExw5Q9kYg6OYKPJKw1ZxJkv6UiEiuoRqktVA7LLuSSBIS/AU hCcC3QeizcvPxjsEoo2NgWyMjIcaUzLTz/F2s4PzIsMoKCgsQ+A9znJhIjY1sPwL7u+D XWV48rweYqtdMTwxGooCS4vL35ve46D5Hk2JenYDarrXTPzWVubmVEchA7HE5Dc0N4pm UZgQ== X-Gm-Message-State: APjAAAUqWU4cs5Ljes/X7BglECHQxWsvjNtKENNR1O8aR2UwK5/XSpzj XZ3JEMDQ5JEN4c2PnfBAcN0= X-Received: by 2002:a2e:b4cb:: with SMTP id r11mr2989831ljm.68.1579195675798; Thu, 16 Jan 2020 09:27:55 -0800 (PST) Received: from pc636 ([37.139.158.167]) by smtp.gmail.com with ESMTPSA id z13sm11141629ljh.21.2020.01.16.09.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 09:27:55 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 16 Jan 2020 18:27:53 +0100 To: "Paul E. McKenney" Cc: Joel Fernandes , "Uladzislau Rezki (Sony)" , LKML , RCU , Steven Rostedt , Oleksiy Avramchenko Subject: Re: [PATCH 1/1] rcu/tree: support kfree_bulk() interface in kfree_rcu() Message-ID: <20200116172753.GB23524@pc636> References: <20191231122241.5702-1-urezki@gmail.com> <20200116011410.GC246464@google.com> <20200116024126.GS2935@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200116024126.GS2935@paulmck-ThinkPad-P72> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 15, 2020 at 06:41:26PM -0800, Paul E. McKenney wrote: > On Wed, Jan 15, 2020 at 08:14:10PM -0500, Joel Fernandes wrote: > > On Tue, Dec 31, 2019 at 01:22:41PM +0100, Uladzislau Rezki (Sony) wrote: > > > kfree_rcu() logic can be improved further by using kfree_bulk() > > > interface along with "basic batching support" introduced earlier. > > > > > > The are at least two advantages of using "bulk" interface: > > > - in case of large number of kfree_rcu() requests kfree_bulk() > > > reduces the per-object overhead caused by calling kfree() > > > per-object. > > > > > > - reduces the number of cache-misses due to "pointer chasing" > > > between objects which can be far spread between each other. > > > > > > This approach defines a new kfree_rcu_bulk_data structure that > > > stores pointers in an array with a specific size. Number of entries > > > in that array depends on PAGE_SIZE making kfree_rcu_bulk_data > > > structure to be exactly one page. > > > > > > Since it deals with "block-chain" technique there is an extra > > > need in dynamic allocation when a new block is required. Memory > > > is allocated with GFP_NOWAIT | __GFP_NOWARN flags, i.e. that > > > allows to skip direct reclaim under low memory condition to > > > prevent stalling and fails silently under high memory pressure. > > > > > > The "emergency path" gets maintained when a system is run out > > > of memory. In that case objects are linked into regular list > > > and that is it. > > > > > > In order to evaluate it, the "rcuperf" was run to analyze how > > > much memory is consumed and what is kfree_bulk() throughput. > > > > > > Testing on the HiKey-960, arm64, 8xCPUs with below parameters: > > > > > > CONFIG_SLAB=y > > > kfree_loops=200000 kfree_alloc_num=1000 kfree_rcu_test=1 > > > > > > 102898760401 ns, loops: 200000, batches: 5822, memory footprint: 158MB > > > 89947009882 ns, loops: 200000, batches: 6715, memory footprint: 115MB > > > > > > rcuperf shows approximately ~12% better throughput(Total time) > > > in case of using "bulk" interface. The "drain logic" or its RCU > > > callback does the work faster that leads to better throughput. > > > > Tested-by: Joel Fernandes (Google) > > > > (Vlad is going to post a v2 which fixes a debugobjects bug but that should > > not have any impact on testing). > > Very good! Uladzislau, could you please add Joel's Tested-by in > your next posting? > I will add for sure, with the a V2 version. Also, i will update the commit message by adding the results related to different slab cache usage, i mean with Joel's recent patch. Thank you. -- Vlad Rezki