Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3619197ybl; Fri, 20 Dec 2019 12:26:43 -0800 (PST) X-Google-Smtp-Source: APXvYqy2rkHljqITZkwheSh2VIWeFoXvHCQtM55WTNG5Qlfz0t8VHhmvIyP3qof/z0ixpka2KZGZ X-Received: by 2002:a9d:68ca:: with SMTP id i10mr16472073oto.178.1576873603799; Fri, 20 Dec 2019 12:26:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576873603; cv=none; d=google.com; s=arc-20160816; b=0+u3mVmIAKqj2WUdjmyBcUtWxQKjRC4LiSeye0IhwxPa8CE2VFUKwxUXMTUVpbTCAE UElFB/z0M0vuOMKLCIyPgDv3NP564H4CdHG7+Tdkrw+IOsvF/HAh22Pr+Iav8hQE5She AWPM5uyn+sWLegmZI9wWR5kqoqL6TgFtV3kZ7nEsI3ZUaUD/weZnzoDr0r3Nv9VKWcds miJRg7rqJtReMpAy9UO/GOtT9bXxgTwDa7O+hevdEHBOxmSrGrIYtJI/oPCUV039oWUM Bx4XmuuCl992m82/ZjYjeCEIsKc5yIPtsOKVGS8fM7/aM6TiZi0+6G0/yX+Bnwf/hOWH /gSA== 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:from:date:dkim-signature; bh=DgxQx9+28OG7P/tSoTPUj1RwIIkipr7p1feEqqcd1ig=; b=sTL56EYZRVZr7QYfcMp/5zmrvl5Du+7UWoyR3CMU08pThF67WjXO3c8UsQbgB3uYT6 PvxkjO2CZNPj56oI0DUjMo/P7I4HQwF+5IUXu1gdtf6rDHc6NYlgRP8P/1fPuQjbQl4v ievRfODKmioC5NP9CMi/cSQRY8J9kJrvezprVM8S0KNLDlt/v5MCLGbY7ngM1+S0d3dQ JlXSYECknpjIPO2InpM6Sd/04r5LnXBHnQc937PUiJyxh3WkZgaOy9/UfSsv+GoIl/bm W5GcKdEfZg4mWr7yLpqCEaoriNbObSokAoQgZ52SYparbEVTG6AgsMM+GPk2gPRVvABs NY7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FV0ppH6c; 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 200si5246262oii.156.2019.12.20.12.26.31; Fri, 20 Dec 2019 12:26:43 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FV0ppH6c; 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 S1727531AbfLTUYA (ORCPT + 99 others); Fri, 20 Dec 2019 15:24:00 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:37518 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727402AbfLTUYA (ORCPT ); Fri, 20 Dec 2019 15:24:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DgxQx9+28OG7P/tSoTPUj1RwIIkipr7p1feEqqcd1ig=; b=FV0ppH6cMvMfOYZcK2cAjPpro XAcw8l+Fo8vfo6cc0aXGtjdbs8NhjUA0aEsJiXVuXsJPZ2oiOEDsw5QGrL4FlbRKSbVLMWVa4kgnT 0mIqhgi909xSTmSgRZyZRJBPzFQnydtZqvfrLQ1AayVs2gQmGaB46x2jM0v3+5cdubGnDNuEcElon 6bUdPako3fOTHFvABl/qvWwPnke0y/7AsTnmm7ZVYJIbJsp+M9RHicZ0RUVnwe2Fk5Dk96o0mpmdL HrFEh8R9tvCLabSgtMn3dTO1Bwv4t0SVqFl2zBNFyQa8FskumqrsznpbSbRoRKkP0OhmvGQPmTv/N H6IjIA0Xw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiOoO-0006ZS-Cg; Fri, 20 Dec 2019 20:23:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F2FA33007F2; Fri, 20 Dec 2019 21:22:21 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 12A0C2024479A; Fri, 20 Dec 2019 21:23:46 +0100 (CET) Date: Fri, 20 Dec 2019 21:23:46 +0100 From: Peter Zijlstra To: Alexey Brodkin Cc: Robin Murphy , Marc Gonzalez , Greg Kroah-Hartman , Rafael Wysocki , LKML , Linux ARM , Dmitry Torokhov , Will Deacon , Russell King , Bjorn Andersson , Tejun Heo , Mark Brown , arcml , Vineet Gupta , Eugeniy Paltsev Subject: Re: [RFC PATCH v1] devres: align devres.data strictly only for devm_kmalloc() Message-ID: <20191220202346.GT2827@hirez.programming.kicks-ass.net> References: <74ae22cd-08c1-d846-3e1d-cbc38db87442@free.fr> <20191220140655.GN2827@hirez.programming.kicks-ass.net> <9be1d523-e92c-836b-b79d-37e880d092a0@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Dec 20, 2019 at 07:32:16PM +0000, Alexey Brodkin wrote: > Well it somehow used to work for quite some time now with the data-buffer > being allocated with 4 words offset (which is 16 bytes for 32-bit platform 3 words, devres_node is 3 words. Which is exactly why we had to change it, the odd alignment caused ARC to explode. > and 32 for 64-bit which is still much less than mentioned 128 bytes). > Or we just never managed to identify those rare cases when data corruption > really happened? The races are rather rare methinks, you'd have to get a list-op concurrently with a DMA. If you get the list corrupted, I'm thinking the crash is fairly likely, albeit really difficuly to debug. > > No matter which way round you allocate devres and data, by necessity > > they're always going to consume the same total amount of memory. > > So then the next option I guess is to separate meta-data from data buffers > completely. Are there any reasons to not do that Dunno, should work just fine I think. > other than the hack we're > discussing here (meta-data in the beginning of the buffer) used to work OK-ish? If meta-data at the beginngin used to work, I don't see why meta-data at the end wouldn't work equally well. They'd be equally broken. But I'm still flabbergasted at the fact that they're doing non-coherent DMA to kmalloc memory, I thought we had a DMA api for that, with a special allocator and everything (but what do I know, I've never used that).