Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1116236ybi; Fri, 12 Jul 2019 10:00:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNFNN1PP8vQ0ldbqT1heJWcjSD3CcmCjnhUvxdHf4O2lJ9sNKIawiJkXSONwBcQ0FnlRAL X-Received: by 2002:a63:205f:: with SMTP id r31mr11901858pgm.159.1562950853868; Fri, 12 Jul 2019 10:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562950853; cv=none; d=google.com; s=arc-20160816; b=I+fbp8X6DzX2lXSqvaIS5HZc/4kKHq3QYCN4GN1JCtl6CvfVpeJHbXpvYSqPRiPrV5 imZ+G4IlcsgsiMIWF7JhKSGSuNip8YkZXSwYhhBHLCB4nFbDve038ikl1dRvpbdFv6Iz 47OfC9jHSBYEB+JK6loRkfwrkxBAvHni4w/bVGWSszfH7WqSHk2ZOdWKg9kkQZ6v4JJc fTEfHK9QZirqqu9zJ8TBW1u1AWW4EDkKAfeMOj0JvbYXW6RWL3k2F9oQiEc90/DeLowV R5Qxj99Nezu7D+WWlZ+oanWcdGj93q/YwmEOwnpyYqvCRnZPQUPVl1pI0vmtfty+jOUe SXkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:illegal-object:cc:to:from; bh=Qvo/X3fwsuPg70LQ01/2ktEVc0homuKlNcYHoFlAaZA=; b=wl/zwi9a4wGo7gx1I+baw9gnI7bC6FRbLc5s3HXRQjT+aVG+mqdKW/svVjlCSlspdz BNyAx2eg26R/0OocryQkKGybAzFyvC+zFsJvReO/J7jhdii7hxG6xCWwb+9g11Zdh4MW GU22wGImCy4GuGKzDWEbdciQ+1/C6vPcOb1efRQzEjFMhk4mpxUwJFBL/EFCR+ZVKHKB tChQrl23oVcNU/NUM7Gid3JNPiP6bW4n6I5sVg48lTYHaMCtTkhMPVOJzq0bYsxgQXTh XTTGV1L+qoOAYHTu8rQnHyT3ny0wh5KtQnBiK5sjH5sJGgwF29rPzNdKqjjo0te2eBuE atyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si8567894pjb.93.2019.07.12.10.00.37; Fri, 12 Jul 2019 10:00:53 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727125AbfGLRAT (ORCPT + 99 others); Fri, 12 Jul 2019 13:00:19 -0400 Received: from mga09.intel.com ([134.134.136.24]:59375 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbfGLRAS (ORCPT ); Fri, 12 Jul 2019 13:00:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2019 10:00:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,483,1557212400"; d="scan'208";a="365210846" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by fmsmga005.fm.intel.com with ESMTP; 12 Jul 2019 10:00:17 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 8518C301004; Fri, 12 Jul 2019 10:00:17 -0700 (PDT) From: Andi Kleen To: Sultan Alsawaf Cc: unlisted-recipients:; (no To-header on input) Jason Gunthorpe , Ming Lei , Palmer Dabbelt , "Martin K. Petersen" , Gal Pressman , Allison Randal , Christophe Leroy , Thomas Gleixner , linux-kernel@vger.kernel.org Illegal-Object: Syntax error in Cc: address found on vger.kernel.org: Cc: unlisted-recipients:; (no To-header on input)Jason Gunthorpe ^-missing end of address Subject: Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining References: <20190712063657.17088-1-sultan@kerneltoast.com> Date: Fri, 12 Jul 2019 10:00:17 -0700 In-Reply-To: <20190712063657.17088-1-sultan@kerneltoast.com> (Sultan Alsawaf's message of "Thu, 11 Jul 2019 23:36:56 -0700") Message-ID: <87lfx39oim.fsf@firstfloor.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sultan Alsawaf writes: > > Abusing repeated kmallocs to produce a large allocation puts strain on > the slab allocator, when kvmalloc can be used instead. The single > kvmalloc allocation for all sg lists reduces the burden on the slab and > page allocators, since for large sg list allocations, this commit > replaces numerous kmalloc calls with one kvmalloc call. Note that vmalloc will eventually cause global TLB flushes, which are very expensive on larger systems. THere are also global locks in vmalloc, which can also cause scaling problems. slab is a lot more optimized. I don't see any performance numbers in your proposal. Did you test these corner cases? I suspect you're better of with larger kmallocs up to a reasonable size. How big would a sg list need to be to need more than a couple pages? -Andi