Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp289447lqp; Thu, 4 Apr 2024 13:15:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXb9IfhzwZTWzlWoF7NwyTGq1gE7l2Ekqd+AczTIq5CJB6FEfxmwPVkCTfE8Nxb15kXJRFUQNsGi14BY0UFCKo1YZ9ILVdoSVm1i2gVg== X-Google-Smtp-Source: AGHT+IFCpeyC8+yoYn+IREo3dF3/4C3VvuIssvS41rl2XN+aaGS9sAyBPS3/3XeP94PmnWA+1oiz X-Received: by 2002:a50:d784:0:b0:56b:9f35:65f9 with SMTP id w4-20020a50d784000000b0056b9f3565f9mr630244edi.0.1712261758346; Thu, 04 Apr 2024 13:15:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712261758; cv=pass; d=google.com; s=arc-20160816; b=OegQj1hfeeimkEjmn+g0fKK9s5WRWC3haeRTjhF8xP4FD7Jon2KY+riLX6zVrwROFA Vam59OMbdj0+TnV8uiipRbtUUEqiJZrGKzbWcyk5Ae57X1mag3eeqH9lAMt0hbN0Avd6 YQANMRekFG+OiGhK7i6ANBsEVcnxYukBPBGhecVM6CQgYVmqXpCfkZ/a0nf0SY5PaEh4 9mOBfD7pBqg8GZ8U/0jvXQu2MNaJ57PucccqGIS+kOb+XGC/OkggNIWeOyS1Eieq1k9h R2Zn/eal/xE4hYgPTVmKTGWx02cxgapDtwQScfTV3kbSW56/hQnA7dsePR6JDLbF4nKr noCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=//sEaafmG5Neg1GFbVukRIXNpCTPW91+OzJ3ZvXlxA4=; fh=XAKsHRQ+K8KHr/mxt7Lnv/C+2DSEk1/w0V3AXkHI9rM=; b=d+ES+JLpQ/daOD+Qu4QzO8pt9CJJfatuXqd7dLkytiawNxpyHWDT7d10qaTNPp00g4 bhDmM4tcct9RpFt7i0gDGmViFXCqbuyGDubIBknGrPQOkkPk7hLH67lYKvqn1mq5hdpr 6/JykH5HxoA6AXVB8PpTywzbSvyazNnsHpey8cHgQIebOU7P9QVwtOBhv+D8htbGbaG2 sMDRzdsSK3DvTvuDRn8hkYYIK8J0GjXmO8J4yoOHLgPDmhxmRUL8UbRBn+5bgf2ES0Ky ezT5xAjF0xQz6wb03/FGyl11hodroG0gELofjFpTphTYdz+fZSJB4/Xg3ktcxf8KyT1Z rW5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="iwYrN/Qa"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-132085-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132085-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n22-20020a05640205d600b0056e0d6cc493si7179edx.121.2024.04.04.13.15.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 13:15:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132085-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="iwYrN/Qa"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-132085-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132085-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0FD491F22388 for ; Thu, 4 Apr 2024 20:15:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60B151350C7; Thu, 4 Apr 2024 20:15:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="iwYrN/Qa" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 840BC134434 for ; Thu, 4 Apr 2024 20:15:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712261751; cv=none; b=J4L+evt1Lhi6LJhbUqFnPlHU+pdgy+hfWH/8b7UErhJz2mUEVYisKV9GhkHuarIVJAByvmydD3jaV4cmUi+X9hsD5RRwm403Wy84gH8d8A69MY6cY2YKeNWBXZmkWAhRQssNQ+gQh/Az9EPgBVZ2iVxrFkx7hxi/I7wM8FXGSF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712261751; c=relaxed/simple; bh=VVWhZr0aCuH2Y5GFYDZW8wnlUR0OXsRJ98VfsKuyNYU=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=LuQ4dFiaWDJTGo0BaVPkuNZNzXH+BPug7DpxoQvbdSZhPdyIQPZmeDQip8Q2jdvHl5mwVvEk37FcEyMHpNJm2ZcU+MM9F7Ay0X94lUvhpDBq4qgE5cZMq7beSXe1xHAFk7FxPXm6AP3D8U8OYKxlYnL6xTke55pbyaC8d7ZEc30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=iwYrN/Qa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEE58C433F1; Thu, 4 Apr 2024 20:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1712261751; bh=VVWhZr0aCuH2Y5GFYDZW8wnlUR0OXsRJ98VfsKuyNYU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iwYrN/Qa6hTknYBmnxoeiYRnZy9dpjnSXd21EX835N/H5e0y5K/5tBmuKYrP7CVVG WRSRyAflKnhkB/7TrVh01xquXXc2wsymfnyILjqOS7OOMO0r2kJBjOdf8a4sub5mAj rRNqtoP3/0dDcAw4OGvVjhr40/g9l2/SIeeSmO/s= Date: Thu, 4 Apr 2024 13:15:49 -0700 From: Andrew Morton To: Frank van der Linden Cc: linux-mm@kvack.org, muchun.song@linux.dev, linux-kernel@vger.kernel.org, Marek Szyprowski , David Hildenbrand Subject: Re: [PATCH 1/2] mm/cma: drop incorrect alignment check in cma_init_reserved_mem Message-Id: <20240404131549.27a454072f7e96530dce2d62@linux-foundation.org> In-Reply-To: <20240404162515.527802-1-fvdl@google.com> References: <20240404162515.527802-1-fvdl@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Thu, 4 Apr 2024 16:25:14 +0000 Frank van der Linden wrote: > cma_init_reserved_mem uses IS_ALIGNED to check if the size > represented by one bit in the cma allocation bitmask is > aligned with CMA_MIN_ALIGNMENT_BYTES (pageblock size). > > However, this is too strict, as this will fail if > order_per_bit > pageblock_order, which is a valid configuration. > > We could check IS_ALIGNED both ways, but since both numbers are > powers of two, no check is needed at all. What are the userspace visible effects of this bug?