Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp84984lqg; Fri, 26 Apr 2024 09:22:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWn/bfjNiNsGLJ4V0eZBdJYPmac7K6gr9V1UNJDnO1y/9LmnApsmxeZ8wMGp0w8+Q9oSOtsLw6MgpK8UayAqSf8QDCNW9ivADgeWuT9HQ== X-Google-Smtp-Source: AGHT+IF1g7EEhm3kAaQQDyq1iwShGkRdy9KwfFQ03puBE+Oi4p+UyLs8Y1ojH4WC5qbnKI58L91G X-Received: by 2002:a05:6a00:2315:b0:6ec:ec8f:d588 with SMTP id h21-20020a056a00231500b006ecec8fd588mr3888520pfh.16.1714148549838; Fri, 26 Apr 2024 09:22:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714148549; cv=pass; d=google.com; s=arc-20160816; b=CR8QJQ9unnH12Nx5pvS7WJAqlh7N57NlXKdlX50Qp3NaVgmET3JTuLT5Rya8kdK6BX eDU3A8BjJptxpgpBR13L8BdSn5NIzRPocrI68JUFr5I5+gSpop8DMLVvH9GIgwQLTA0n uGF5hqgTq2fTaJQbWk7hjOdo08g2q/u2pMMYd/bJ7kSpfnGAlCiWRE3jJ6gqhu4tbuSB hTUrrHQQkbSEF2LhqE4oZFZj4zhxuzr3v2WLGYzY5yezK7Coz/N5p+KvGk+DRJ63//n+ bjFRe7cYNuUe43BZn2HZq94KKvklZbRHK3cJbrOR+Wgw1MLsEjPwHdcvv2vqqQlMp9sL m1bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :references:in-reply-to:from:organization:dkim-signature; bh=5unUVLjNo+qjBW1OspxyrCDGLZZ03wMYpF4fiHvTxL0=; fh=hiZmJxygXqFn+O95WjesMwcGzJAoAeblYqk3vO2W2/o=; b=XtKsfnTvgb9q3n6KMQCBUZuNrHbV5D+rFt6JIGm0gMvSL0epWw+Q6kZMwGO8uWosxT AOYVfRyKu3R6vZ71/9QHbG2sDsK1Xkg3OdlgWMRtaiGKFX8D1N/99y9sLgTDtMKz7A2u JKVGA6kWfSGCmP8mspx7UCaavsD/HeJn4KcO9rqqGv42YcJRX4WyFiDb8nIwcCIcJp/T p3/bWXc4hAWF0NDgsmUxFv2sWpRwxtOkkANyUvX1rCRVs+QRpU2AjzOq+rOwg6vH5QfG 980XxH9V8qyzmjQnd6/oh3oEwYPdniQ/5M8XvhzJe4JpxALi0AXGW+eJXofG5BvlLd24 bL1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OAIJPUmm; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-160338-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160338-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x9-20020a056a000bc900b006edca539524si15208230pfu.269.2024.04.26.09.22.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 09:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160338-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OAIJPUmm; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-160338-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160338-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D3F8BB25C26 for ; Fri, 26 Apr 2024 15:58:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A106A14A600; Fri, 26 Apr 2024 15:57:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OAIJPUmm" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 486A113D2B7 for ; Fri, 26 Apr 2024 15:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714147073; cv=none; b=P442NQ5tXIqCfTPmA5fXv+G/elfP4wq59u4IbX0g3ajUxNiaBhtCkfhSJOdDc2qpD5M9IhHhfaGiPGiNM921hS7cnI3QqKK2+8ErWnWcCM2PSgCNc/3cEEqE97msasAEAl7emoov5FLYGSZklhZx/Q0XDSrbij9x5My/V+gvcrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714147073; c=relaxed/simple; bh=tVZm1NOaOpfDBvnM6Oow6dJig4w3fLjQoaLBHwmyJD8=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=FbVOJ6nK7I1drhfnmGZVlMjz6kl5XMsk3pi15s4TnItUQBU/XYuFQ2uBkvpVOnxX7XJ/MMpWRDzfNZNFoGvCRBJq6oNIdVC4G71cGp2f9D/NVcXy5/eCOqWm7zsKPn/NTluUCB8+17INcgTvXdArHditNj8oVXrSSt3KjrB4zg4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OAIJPUmm; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714147071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5unUVLjNo+qjBW1OspxyrCDGLZZ03wMYpF4fiHvTxL0=; b=OAIJPUmmaYC2Y9WMiSBycVK1RkAT5y91u2mreq95Ce9QXhssNsBY6ELW05LdU+kCMNsQyW pw4men4cfee+EN2+KwIgOKmNFABkibizE4qC/vLdQU9lWQ+kWvGerz3mUWZUgkI6yPIGI6 Yhd7UCU0AjhaAMLY+kAsr5opmM6uw0w= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-142-Z51XDStMMs6IW8dDyTwKbw-1; Fri, 26 Apr 2024 11:57:49 -0400 X-MC-Unique: Z51XDStMMs6IW8dDyTwKbw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 143C93C000A1; Fri, 26 Apr 2024 15:57:49 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id B94C3492BC7; Fri, 26 Apr 2024 15:57:47 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20240422115541.38548-1-linyunsheng@huawei.com> References: <20240422115541.38548-1-linyunsheng@huawei.com> To: Yunsheng Lin Cc: dhowells@redhat.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Duyck , Marc Dionne , Eric Dumazet , linux-afs@lists.infradead.org Subject: Re: [PATCH net] rxrpc: Fix using alignmask being zero for __page_frag_alloc_align() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2650222.1714147067.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Apr 2024 16:57:47 +0100 Message-ID: <2650223.1714147067@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Yunsheng Lin wrote: > rxrpc_alloc_data_txbuf() may be called with data_align being > zero in none_alloc_txbuf() and rxkad_alloc_txbuf(), data_align > is supposed to be an order-based alignment value, but zero is > not a valid order-based alignment value Ummm... 0 *would be* a valid order-based[*] alignment (pow(2,0) is 1). It might actually make more sense to do that than to pass in the number of by= tes, then 0 is the default, but either way works. [*] Other places that take an order-based parameter include things like alloc_pages(). The number of pages being requested is pow(2,order). > + return rxrpc_alloc_data_txbuf(call, min_t(size_t, remain, RXRPC_JUMBO_= DATALEN), 1U, gfp); > + return rxrpc_alloc_data_txbuf(call, space, 1U, gfp); The 'U' should be unnecessary. > + data_align =3D max_t(size_t, data_align, L1_CACHE_BYTES); data_align =3D umax(data_align, L1_CACHE_BYTES); would be better, I think. Anyway, with the umax change above: Acked-by: David Howells