From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74E14C43603 for ; Fri, 20 Dec 2019 20:23:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 314E0206D8 for ; Fri, 20 Dec 2019 20:23:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NHmh4fgq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 314E0206D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oLh0ekNKVKJG+NgjSGR8J1TZslb+C6vP9f9LRYbPsMY=; b=NHmh4fgqE+rsHi 0mLUi5qKcjFEq+g90Hd35k5t31MiULm7O0ATutW0lBh/YXxYfDP5OZ6zK9wa/03xvM87LlAZfa4If w8PI1HCbzw3Hd7voWDmCWsZc86f3wNvG7VjJShH21qYxwkphbsKNx9Yg6bsPDs3Jw0jY/L/jzqwGX p6kOJzCnbgWInEbsIA/dAFK/bIXhpVjH8frG8Lp5fjG1P3gyjOP7ToorW4BSy2bvN7bsUm2xIO3XP aUK6rCKTLVlW9qlLumFmC65relcMBhdJhJrh5P5CpNiA7tMaUNJPlKe14eQDi+Ig9d2YdlhIrtw+d SG9UWtokXu0irGhgEV8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiOoT-0006Zd-4t; Fri, 20 Dec 2019 20:23:53 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Will Deacon , Marc Gonzalez , Eugeniy Paltsev , Greg Kroah-Hartman , Vineet Gupta , Dmitry Torokhov , Rafael Wysocki , LKML , Bjorn Andersson , Russell King , Mark Brown , Tejun Heo , arcml , Robin Murphy , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel