Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1014571rwb; Thu, 10 Nov 2022 10:04:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM7WhTb17KRWrGMbmL3oMzJRYzLkhP/BFQnIRq1J+/FWLlLTtk8/EJm/hvaC0TWbzAoyrsqJ X-Received: by 2002:a17:90b:4ad1:b0:20d:bc7f:4fee with SMTP id mh17-20020a17090b4ad100b0020dbc7f4feemr1639990pjb.168.1668103475710; Thu, 10 Nov 2022 10:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668103475; cv=none; d=google.com; s=arc-20160816; b=B+SjRK4CXweNOf6Mv94jzw+NQfttz82SWhei95vr+3JcvNy/KJU9hs1g0fvkiOK//A ZVr/nuo1R7coJKxTUlpny9q0dDn//3H1+knpZr1Qocnzv6sWAokR+hZHh/zJD45IRJbh lhLtUs/eiUyVoTINcoYmh3TszgM+0++gMxqlUt3SI0Q41ATGDeA9J7AKek0aj53o3DL0 rE6Jnmk4fB39LEgfVAq62fNvl2IPVhrC8+y7j1MW0jy9knkf39fCkAZXYXciaKQOx/bR DDhnChTtCkkIucqWZOdUQSFwqcSge/eZ/khzyd30rfjFCA+1gcddSafn6de1M6thLTd2 SPqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x+QCdRZ/JfoXhX+rWKt8rf0Poetyt6zzg0FgqSCk/4E=; b=vy2cHJVBYZBLj8qroZtqx+PN9RFkVagoZhV+yOYb7D1gZ2I19+SPyfELZYr9d+rEc0 /UHJiFxjeKVR5vlR1Utq3wsaTEtQ+Qd7tF2G0Td4CV8jTap9yf5Ox6clCVO97ISSjOWP t1Gfkoc6UAbeXetiujznMG1+AO45vCpDy3GsEU/Eqw0kTR9MQC9vUa88T19j8lUIbFth MiWcNCMYNiYxMDptsELMIvbs8RlgvqCXhbmT9R9L/Y1Pwq8gUOSf5FR90Fp837G1eHXZ 7NiwjxwgrN7NyeV6UHanduhCLKyAgLfVxZadnj3Kj3exh/z0l8WKrNCQWtmZzvg1Qjyt wNUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="rW1N/RwP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a170902a50600b00186c3afb4besi18107572plq.243.2022.11.10.10.04.20; Thu, 10 Nov 2022 10:04:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="rW1N/RwP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230497AbiKJQUR (ORCPT + 92 others); Thu, 10 Nov 2022 11:20:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbiKJQUP (ORCPT ); Thu, 10 Nov 2022 11:20:15 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C631F1AD85 for ; Thu, 10 Nov 2022 08:20:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=x+QCdRZ/JfoXhX+rWKt8rf0Poetyt6zzg0FgqSCk/4E=; b=rW1N/RwPBsMIKgFZJxtvG9cGpW 3LC2lY5EWKeVQIrq03W5q23NQDuNi4ggOO9Bi9h15RwmePBdhWG1BqMTNa2rdt0jGuEwWCEq//MsS CQzT9T6xaaqpfVmQuInWqWSIpgKctL+tfaPqX+lFNqhkWLIlhc3wdSaRFYM92GKsKgcZmKo/0ATo3 2qCb2HDLQT4+Fm2Ir5Esv22W8jqx7LWlcx1QB2RN/97vA6is3BaTCcbu6SvHBcypZiFyHmdSW+Dtr UanCdz7ie7xULs8Khg1NzQr4mvun+wd654tBXHbFJKdwIEN/jxJRz0f9KgNGy8iAGZe8CfZnviZ5p rpSiw04A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1otAHc-00CCgi-Q0; Thu, 10 Nov 2022 16:20:04 +0000 Date: Thu, 10 Nov 2022 16:20:04 +0000 From: Matthew Wilcox To: Vlastimil Babka Cc: Theodore Ts'o , Aaro Koskinen , Linus Torvalds , Paul Cercueil , 42.hyeyoo@gmail.com, akpm@linux-foundation.org, catalin.marinas@arm.com, cl@linux.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penberg@kernel.org, rientjes@google.com, rkovhaev@gmail.com, roman.gushchin@linux.dev, Feng Tang Subject: Re: Deprecating and removing SLOB Message-ID: References: <20221109234832.GE307514@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2022 at 08:31:31AM +0100, Vlastimil Babka wrote: > > octeon-hcd will crash the kernel when SLOB is used. This usually happens > > after the 18-byte control transfer when a device descriptor is read. > > The DMA engine is always transfering full 32-bit words and if the > > transfer is shorter, some random garbage appears after the buffer. > > The problem is not visible with SLUB since it rounds up the allocations > > to word boundary, and the extra bytes will go undetected. > > Ah, actually it wouldn't *now* as SLUB would make the allocation fall into > kmalloc-32 cache and only add redzone beyond 32 bytes. But with upcoming > changes by Feng Tang, this should work. This is kind of "if a bug stings a tree in a forest, does it hurt" problem. If all allocations of 18 bytes are rounded up to 20 or more bytes, then it doesn't matter that the device has this bug. Sure, it may end up hurting in the future if we decide to create 18-byte slab caches, but it's not actually going to affect anything today (and we seem to be moving towards less precision in order to get more performance)