Received: by 10.223.176.5 with SMTP id f5csp806507wra; Wed, 7 Feb 2018 07:51:48 -0800 (PST) X-Google-Smtp-Source: AH8x226MBfShNcVz1afWliereact7qCImw6ZBU1wJwr57U73LFPGcKUc+D/ssMP5mGAJEqXQZ+hy X-Received: by 10.98.181.14 with SMTP id y14mr6475869pfe.216.1518018708377; Wed, 07 Feb 2018 07:51:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518018708; cv=none; d=google.com; s=arc-20160816; b=LEeoPsU9KZDr3I2ZSyy6s1iiqQ1f4c9O8altcOnmoqEYkHDehuelq21Nk4JMSs++aF Kc4eeB1A6Ls0r+2xObZWGoAYyufrMIV71r7MzfYYzfNCEyWmvcHwcQe0ka813b38PD2q oTz4pjwX615miXT5EjhnRUKGa6tv9jtUTl1XltMJnQAjVqFCa8QmIuv7pO1jrsFYAOQL DBRfx5/UZSMK1YXWJ85VwsDaXBjYUmfhQ/CV7o66Ex8fmaiIoebT28M1gjAIvdbH1/TA 7yVUk67QVZyJrwTNjN8b5fR+gexSIKg+cMx7b3SW7ppjZRA99KTiBMI0QG+aW6NHyAJx 3Oiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=E3WmmMjPqSEtc8c+zPD2l7EPB/nrqItVpbCaXbS4FwI=; b=KukyHrLCtpj7giukRXY9tbP4pEYaxnuOXRx8wFZ0RD8rSp1r1cr00YaRbqxDi97lYq Cmxl3X6xijNb/p5L2kJaTYjN6RifaAnO0nMM0K/6jaIKai+nrvNrhlIWziZZLnbc+nSa +sUT9AI7XNB6/vyZUb1kB4FRmTsSc3qiJ3JbvreoZhd4OXdMSN9J6lrbJOzoXId/9GWV feNwEIR74a+DItoQZ9p9x+tbFuuoqQrmiW1CQHBV9Q4g9mvCLewsjRbgYSd098vrAc2o Uv+lW7k0jqPQSYLQ908TGJxCtzp4szX3+ChWpBNRFFUJpaiVAiwB3Y3Ts9EkbdWNorOM aPEg== 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 v12si1065083pgq.50.2018.02.07.07.51.34; Wed, 07 Feb 2018 07:51: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; 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 S1754546AbeBGPtj (ORCPT + 99 others); Wed, 7 Feb 2018 10:49:39 -0500 Received: from mga05.intel.com ([192.55.52.43]:15544 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754254AbeBGPti (ORCPT ); Wed, 7 Feb 2018 10:49:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 07:49:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="16695422" Received: from alexey-system-product-name.iil.intel.com (HELO [10.236.193.131]) ([10.236.193.131]) by orsmga006.jf.intel.com with ESMTP; 07 Feb 2018 07:49:29 -0800 Subject: Re: staging: ion: ION allocation fall back order depends on heap linkage order To: Laura Abbott , devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org References: <58951af2-a84e-7d7c-e956-ece3190aa8c2@redhat.com> <0217ee91-25fa-f563-81bd-ba4ad4dc9377@intel.com> <3f77b591-6248-da0a-e20d-88ca26a60a95@intel.com> <9aab5e55-a2f1-b05d-3568-0a4491ff51f1@redhat.com> From: Alexey Skidanov Message-ID: <6fdcc9d7-1a40-f450-c8ed-8f77f4f6768f@intel.com> Date: Wed, 7 Feb 2018 17:49:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <9aab5e55-a2f1-b05d-3568-0a4491ff51f1@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/07/2018 05:32 PM, Laura Abbott wrote: > On 02/07/2018 07:10 AM, Alexey Skidanov wrote: >> >> >> On 02/07/2018 04:58 PM, Laura Abbott wrote: >>> On 02/06/2018 11:05 PM, Alexey Skidanov wrote: >>>> >>>> >>>>> Yup, you've hit upon a key problem. Having fallbacks be stable >>>>> was always a problem and the recommendation these days is to >>>>> not rely on them. You can specify a heap at a time and fallback >>>>> manually if you want that behavior. >>>>> >>>>> If you have a proposal to make fallbacks work reliably without >>>>> overly complicating the ABI I'm happy to review it. >>>>> >>>>> Thanks, >>>>> Laura >>>>> >>>> I think it's possible to "automate" the "manual fallback" behavior. But >>>> the real issues is using heap id to specify the particular heap object. >>>> >>>> Current API (allocation IOCTL) requires to specify the particular heap >>>> object by using heap id. From the other hand, the user space doesn't >>>> control the heaps creation order and heap id assignment. So it may be >>>> tricky, especially when more than one object of the same heap type is >>>> created automatically. >>>> >>>> Thanks, >>>> Alexey >>>> >>>> >>> >>> The query ioctl is designed to get the heap ID information without >>> needing to rely on the linking order or anything else defined in >>> the kernel. >>> >>> Thanks, >>> Laura >> >> That is true. But if we have 2 *automatically created* heaps of the same >> type, how userspace can distinguish between them? >> >> Thanks, >> Alexey >> > > The query ioctl also gives the name which should be different > for each heap. It's not ideal but the name/heap type are the best > way to differentiate between heaps without resorting to hard > coding. > > Thanks, > Laura You are correct ... It will work (assuming that user space developer knows where to look for the name :) ) So, the userspace may pass the list of pairs [heap type, name] (as part of allocation ioctl) defining the fallback order. Thanks, Alexey