From owner-freebsd-arch@freebsd.org Sun Feb 10 09:15:48 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7948C14E6778 for ; Sun, 10 Feb 2019 09:15:48 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 723856E389 for ; Sun, 10 Feb 2019 09:15:47 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-pf1-x42a.google.com with SMTP id u6so3779625pfh.11 for ; Sun, 10 Feb 2019 01:15:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=T8lYjB9VnsDti8oZUcCn60UafsiLjnL9vPEqBjxgJao=; b=LPnBLcvI/+FjpN6YghmCu66BANn6KY4u7ez20iFPVqINcnUSnqRYethYqnIE4Dcw77 D0tkCmrcA1ZFNCSD971gG9RabyYKpju1+Q4SZ/C4dTWrh1RTaKzmxdVu6XeZ/V089PW+ ye9bu2VL9yJV798m2PqfHNuvmMoBjTnp54Hwwax/9Rr8obxuAbh8LGf1I70pE0W6sUAh QKGlUPT7ptVD0o6bmjlCG3y/0nL1TkKD0vD/lIAzywZQFAs5IupFaTi+bLZzl0OmxMV3 JwI37AiEkr44nquVpcsS6xn4sssAx8eeikWU8bdhBxXbbNLgjFVJjk46E0A96GfTt3De KxVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=T8lYjB9VnsDti8oZUcCn60UafsiLjnL9vPEqBjxgJao=; b=Mzer/oe61trbdDXS5fEuVH0jsMmsRDBVfzkXxIq55T65C12MDCoeam9Pbq9f0Zaatt 7hPd7dKIBor7GAHh1VgMDnmbiXVC4lkt9kWy5WbhUZZ86brRP6keS/wpMAzFMPfxRtkb GGpy1xH4Ku4+uOB4qfceVIxG7tdyurUJKXLzwq0KDOMJIhFvoHP3srRlrc5CkFRPwx4u HdMXQEyCapGrDi4kShbV8sgO97S56GsnEPhEqQRK1Yd1O/xoP0AS1xO8mgoJr3ODcyiq 0wG09wEFzRY4uQNGo5kk+rAHziMn75Olq21nOACnr8tVg4nbG1n2KKHJ5LuHEZeyfXUt 5RUA== X-Gm-Message-State: AHQUAubF2YjYx09cUCJj/m2gsOJX4KlJYd8+QU2rY/hrE7Ixr46iEvGw rp17upsSklZmep5DW/Tu6TgaF+8= X-Google-Smtp-Source: AHgI3Ia4ZCufP4sgY0VLk4lgmu8Qcehbr+ezlU+uGmDf2RzMpQUlYCsbdhAWCSeCM1pSEIwUSFGC5g== X-Received: by 2002:a63:d84e:: with SMTP id k14mr20713474pgj.436.1549790146142; Sun, 10 Feb 2019 01:15:46 -0800 (PST) Received: from [192.168.1.2] (c-67-188-30-11.hsd1.ca.comcast.net. [67.188.30.11]) by smtp.googlemail.com with ESMTPSA id g20sm12007215pfg.85.2019.02.10.01.15.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 01:15:45 -0800 (PST) To: FreeBSD Arch From: Jason Harmening Subject: Any desire for a more flexible bus_dmamem_alloc variant ? Message-ID: Date: Sun, 10 Feb 2019 01:13:32 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 723856E389 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=LPnBLcvI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of jasonharmening@gmail.com designates 2607:f8b0:4864:20::42a as permitted sender) smtp.mailfrom=jasonharmening@gmail.com X-Spamd-Result: default: False [-5.61 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.92)[-0.922,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[a.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.68)[ip: (-8.90), ipnet: 2607:f8b0::/32(-2.46), asn: 15169(-1.95), country: US(-0.07)] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2019 09:15:48 -0000 Hi everyone, It's really bugged me for years that bus_dmamem_alloc() just uses the tag's maximum size instead of allowing a size to be passed in. I got reminded of this again recently when looking over some busdma code. I know others have voiced this complaint in the past: https://lists.freebsd.org/pipermail/freebsd-current/2012-July/035281.html I used to work on an out-of-tree driver that could've benefited from something like this. It also seems like the benefits of using bus_dmamem_alloc() to always do the optimal thing instead of, say, rolling your own using kmem_alloc_[attr|contig] will increase as we adopt support for IOMMUs. I'd like to see if there's any interest in adding a bus_dmamem_alloc_attr() KPI that takes both a size and vm_memattr_t. Are there any potential in-tree consumers of such a thing? --Jason