Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4961095ybl; Tue, 4 Feb 2020 05:15:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwmIJ7qrbm5suLxPcWvZkjvLxb/+1CK8k7oP7AZDRzcF4KAfT461dT4AarfRGbmfFbXVkTP X-Received: by 2002:a05:6830:18f1:: with SMTP id d17mr21731234otf.303.1580822146054; Tue, 04 Feb 2020 05:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580822146; cv=none; d=google.com; s=arc-20160816; b=lkEzEm/u6DuZH4b0R48nxSbzDntjbL76guFQZJ7GyD6fmIZlscnBmu7rSdvhJrHEu3 TerBSiTdufbNjRihFn6GJF+H+BoJf8LVrYOpi7s9tZcC9lLGQquTONvuFGqr4NpsY7lb hHPcDKMAYukZE1kX2UeZ9TECGg/YSrnH89dKeOP9NF3CqijyjGUijtgP2ItSIVh7IYWA S201QriWiJ02QYKvg993VMUfvHal2AaTxJCzjXUT4CMW0uAZa46mYM3Flwy/Q66CnVP/ SRoY6MBr+u5sR7UtnC3GmUav4SnqyTj0PUtkIKGGRXIuyrVn/2YtNVVT3ev1UloeYr6M gYsg== 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; bh=XFLFalg5VuBpsP3HpIvE4mfcqVJoltw9YEkq4l6qzBQ=; b=NobLPVL6B3uJElIYO2Ty9QogU/6+MvkvU+8kwFXzYZ7La7npjAVY+C7yt4L25GNP9K 0OEFupIzombczBVdAvRTDJe2+0MOU2tm+eDQv/mbj23ZBcvorqVpgM3iVHwfTFUgh4x+ QIO2sxw/HcXmnS+4rP2g2IKg14/oA4fX/SB/HVq3i9nO6S2U/4HGhRqALh5uPyVEMEGe gBCg4NKmBTn2lIJ4rAbyM5MY/2XvfoIuh7s+Sa/XeShMJ8Y1tUt42invdLPeNBiGpoj6 iYgv0lUztOIut1zVSWV59i4ZPLxkUBbrQqrSaQfdMF3k3cOYmuZnc5t+Di/5e0uxgEv9 d2OA== ARC-Authentication-Results: i=1; mx.google.com; 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 l15si9716465oic.220.2020.02.04.05.15.32; Tue, 04 Feb 2020 05:15:46 -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; 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 S1727230AbgBDNOd (ORCPT + 99 others); Tue, 4 Feb 2020 08:14:33 -0500 Received: from gate.crashing.org ([63.228.1.57]:48721 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727168AbgBDNOd (ORCPT ); Tue, 4 Feb 2020 08:14:33 -0500 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 014DDuF4027799; Tue, 4 Feb 2020 07:13:56 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 014DDrtu027796; Tue, 4 Feb 2020 07:13:53 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 4 Feb 2020 07:13:53 -0600 From: Segher Boessenkool To: David Hildenbrand Cc: Oscar Salvador , linux-s390@vger.kernel.org, Michal Hocko , linux-ia64@vger.kernel.org, Pavel Tatashin , linux-sh@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Wei Yang , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Dan Williams , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages() Message-ID: <20200204131353.GJ22482@gate.crashing.org> References: <20191006085646.5768-1-david@redhat.com> <20191006085646.5768-11-david@redhat.com> <20200204094652.GE6494@linux> <5d698f94-af18-0714-bc97-14b6c520572c@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d698f94-af18-0714-bc97-14b6c520572c@redhat.com> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote: > On 04.02.20 10:46, Oscar Salvador wrote: > > I have to confess that it took me while to wrap around my head > > with the new min() change, but looks ok: > > It's a pattern commonly used in compilers and emulators to calculate the > number of bytes to the next block/alignment. (we're missing a macro > (like we have ALIGN_UP/IS_ALIGNED) for that - but it's hard to come up > with a good name (e.g., SIZE_TO_NEXT_ALIGN) . You can just write the easy to understand ... ALIGN_UP(x) - x ... which is better *without* having a separate name. Does that not generate good machine code for you? Segher