Received: by 10.192.165.156 with SMTP id m28csp230378imm; Wed, 18 Apr 2018 21:03:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2XnF/6QbHF7mI9EI3ApEvxBs4AeYotq23DEqmVj+E/JHuWEzcqfFO4zQ4aV6QzCJSSwEo X-Received: by 10.101.74.201 with SMTP id c9mr736175pgu.26.1524110607798; Wed, 18 Apr 2018 21:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524110607; cv=none; d=google.com; s=arc-20160816; b=W3+B7nA8OPRc+KCa3JltFJFyuzrYIvnw2OHk+w6QOYfm9XMvRUywrsH1OWWAWPHY1U iof+Ezp2Nw8ANCJNvQ1sl39QJxA5GGoa+vwEcub379lsECsgD9fJcrdb555LFzGIbeg5 hZRiKRN6RGlR+4eYDv4kpDP3/SfQTmOLh5XSkuRVxDye7zXTDjqOPrjOHy9kaQTJA9VM llb6AZlJwmJEgiGs2gnYMWE3GBvPlw3fVrTN+TbiRRNAc5tCxoipHYSGFKuXdjsgMaxG CfngUgDZt6wsncbG0j4fSwqZd16Kud1788JJn3m2bOz9D0ttRYIQb1kk0BdbwXeXWxMU CcoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=5Y1ZSrZcGmW8UUD/D1UPoLIH1hURAflLF15yY5UdDX0=; b=Yc5Cib0EYBi+ptAiJ+50VHqVTPu6HY+jo7eGzjca1lsEA4Fl5Hi4fl2wF+x1Eg0pTI gN5ZyxEQNoB/m87fyphR7XA5ChDyQinVW53WcjndFCN6QyQm4unyKDdH43sAwc2LDJ+q XQ2aC9qKGV02AgXWn0SLuLcZEisH2FBQXgbWvZtsT9S+Gg8C9U+L4GX/ytSfyjYsJg/n 3MQCLVudkMHSQFaqXO2L5b2otvQSuisw545sDTDFJ9Y8IjnjqD+IdzxphBBNkqCjJ9Ls tGDPP6yVATssOHWK3XDqlqJqmBdlfjlWAI7a1dxDzLzeZjWAZDqCu3Iyc41OjKDJibtT SYfw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20-v6si2649340plp.7.2018.04.18.21.02.54; Wed, 18 Apr 2018 21:03:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751184AbeDSEA4 (ORCPT + 99 others); Thu, 19 Apr 2018 00:00:56 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750737AbeDSEAz (ORCPT ); Thu, 19 Apr 2018 00:00:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4BD04073191; Thu, 19 Apr 2018 04:00:54 +0000 (UTC) Received: from redhat.com (ovpn-120-175.rdu2.redhat.com [10.10.120.175]) by smtp.corp.redhat.com (Postfix) with SMTP id 64EBC215CDC8; Thu, 19 Apr 2018 04:00:53 +0000 (UTC) Date: Thu, 19 Apr 2018 07:00:53 +0300 From: "Michael S. Tsirkin" To: Eric Dumazet Cc: Mikulas Patocka , "David S. Miller" , Eric Dumazet , Joby Poriyath , Ben Hutchings , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: don't use kvzalloc for DMA memory Message-ID: <20180419065711-mutt-send-email-mst@kernel.org> References: <3e65977e-53cd-bf09-bc4b-0ce40e9091fe@gmail.com> <20180418204229-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 19 Apr 2018 04:00:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 19 Apr 2018 04:00:54 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 18, 2018 at 01:38:43PM -0700, Eric Dumazet wrote: > > > On 04/18/2018 10:55 AM, Michael S. Tsirkin wrote: > > > Imagine you want to pass some data to card. > > Natural thing is to just put it in a variable and start DMA. > > However DMA API disallows stack access nowdays, > > so it's natural to put this within struct device. > > > > See e.g. > > > > commit a725ee3e44e39dab1ec82cc745899a785d2a555e > > Author: Andy Lutomirski > > Date: Mon Jul 18 15:34:49 2016 -0700 > > > > virtio-net: Remove more stack DMA > > > > Andy just moved the problem to another one, since at that time we already > had vmalloc() fallback for at least 2 years. > > Note that my original patch had : > > p = kzalloc(alloc_size, GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); > if (!p) > p = vzalloc(alloc_size); > > So really, normal (less than PAGE_SIZE) allocations would have almost-zero-chance to end up to vmalloc(one_page) Thanks Eric, I'll fix virtio. -- MST