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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B4F2C433EF for ; Tue, 26 Apr 2022 17:37:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE8996B0073; Tue, 26 Apr 2022 13:37:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E70F56B0074; Tue, 26 Apr 2022 13:37:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEAA56B0075; Tue, 26 Apr 2022 13:37:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id BBC566B0073 for ; Tue, 26 Apr 2022 13:37:51 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 922B1F92 for ; Tue, 26 Apr 2022 17:37:51 +0000 (UTC) X-FDA: 79399737942.20.09C291B Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by imf26.hostedemail.com (Postfix) with ESMTP id 65C3114003D for ; Tue, 26 Apr 2022 17:37:49 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id s30so6291990ybi.8 for ; Tue, 26 Apr 2022 10:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclypsium.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tH/YgBif6d6yzwmumvRLfWV+AljH646yqRcC2C5Xmag=; b=El35gwLQGL+3kGJERF8gp0inRfDgb8jqvTTV/IGHhywPc7DF/bR5K5hk5LRBmn1uqL vGL5Go4qrIdBIKDY8qV3+z0bU1A1YLWT/DGoTiV8/NEKbUTdllXwl4YUrLR5cDoSNiix 5BzO3+o/yqTvkpGlQY7PjxOnAsG7WJJcl0Gcbc1k0C4vcro8NNETJPFo+773PN0ej84I tAcTq/yj0TWaXXih9rfMtTD+Cza2WtiLwjJjP25UximL75DGVuC/RNDWBH753+8WnBvl Ed7gzIkSgtuYjGN5NS5T+PNWhUGjiUbr2uPDA3lVTxp+/SiawFEhTZJTa5VOUnz4toOV yGpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tH/YgBif6d6yzwmumvRLfWV+AljH646yqRcC2C5Xmag=; b=rQKIDedkFpDrtxaTIMOvL7DKpTWojP3LuobPcCTImfxVVF1LjVA5nV9XRZmb+ZLUer M7mZWRQ5vXkgHm9dNrY/k6xQuJnV7uMpsswytkCDi8K7zqhFL6pJSLFC3aGlhvabWKqs R2amoMBc25+48TJQYqPktfJJlTaXQ/r0dl7L9XGVLKXqZlJGOEIlFvcjdUWzGCcDDecW ITeCNZfOwhQXeMwSLn3WsRC3sP253NtbCGYecQy/C81oqMandPp9miSR+dlgiYWVqoeC 2DbP9sRljYCahsVmg4kMDq3C9ebdwv6ua0DyljyeV9WwH/YofoCUoK36+A1DY6nVN9sp VW/g== X-Gm-Message-State: AOAM530cjO/6Kbj42+FSzFcm011a9J6HiwVDa8noVYmtTy5wT2Hs6x+Q a3/54wqc0MWz+z8voqRBqLlKPkM1dDyoaiISgbQaRw== X-Google-Smtp-Source: ABdhPJz1HJ1Wqfc/OMXGlEWodjJTdhl+j6KWkOff8Bx0FMZco18xRQS2BiQyyC+zw/RofYtnfxABe28XP3iE3H3aNyo= X-Received: by 2002:a05:6902:150c:b0:648:94be:2c7e with SMTP id q12-20020a056902150c00b0064894be2c7emr7100545ybu.601.1650994670167; Tue, 26 Apr 2022 10:37:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a81:10a:0:0:0:0:0 with HTTP; Tue, 26 Apr 2022 10:37:49 -0700 (PDT) In-Reply-To: References: <20220425171526.44925-1-martin.fernandez@eclypsium.com> <20220425171526.44925-6-martin.fernandez@eclypsium.com> From: Martin Fernandez Date: Tue, 26 Apr 2022 14:37:49 -0300 Message-ID: Subject: Re: [PATCH v7 5/8] x86/e820: Refactor e820__range_remove To: Dave Hansen Cc: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, dvhart@infradead.org, andy@infradead.org, gregkh@linuxfoundation.org, rafael@kernel.org, rppt@kernel.org, akpm@linux-foundation.org, daniel.gutson@eclypsium.com, hughsient@gmail.com, alex.bazhaniuk@eclypsium.com, alison.schofield@intel.com, keescook@chromium.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 65C3114003D X-Stat-Signature: 3818fpig3cdkxsncutayfh5rw8mnohzw X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=eclypsium.com header.s=google header.b=El35gwLQ; spf=pass (imf26.hostedemail.com: domain of martin.fernandez@eclypsium.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=martin.fernandez@eclypsium.com; dmarc=pass (policy=quarantine) header.from=eclypsium.com X-Rspamd-Server: rspam09 X-HE-Tag: 1650994669-269041 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/26/22, Dave Hansen wrote: > On 4/25/22 10:15, Martin Fernandez wrote: >> +/** >> + * e820__range_remove() - Remove an address range from e820_table. >> + * @start: Start of the address range. >> + * @size: Size of the address range. >> + * @old_type: Type of the entries that we want to remove. >> + * @check_type: Bool to decide if ignore @old_type or not. >> + * >> + * Remove [@start, @start + @size) from e820_table. If @check_type is >> + * true remove only entries with type @old_type. >> + * >> + * Return: The size removed. >> + */ > > The refactoring looks promising. But, there's a *LOT* of kerneldoc > noise, like: > >> + * @table: Target e820_table. >> + * @start: Start of the range. >> + * @size: Size of the range. > > and this: > >> + * struct e820_type_updater_data - Helper type for >> + * __e820__range_update(). >> + * @old_type: old_type parameter of __e820__range_update(). >> + * @new_type: new_type parameter of __e820__range_update(). > > Those are just a pure waste of bytes. I suspect some more judicious > function comments would also make the diffstat look more palatable. > I can get rid off of the kerneldocs and just put normal comments for some functions that really need them. > Also, in general, the naming is a bit verbose. You might want to trim > some of those names down, like: > >> +static bool __init crypto_updater__should_update(const struct e820_entry >> *entry, >> + const void *data) >> +{ >> + const struct e820_crypto_updater_data *crypto_updater_data = >> + (const struct e820_crypto_updater_data *)data; > Yes I agree on this. Do you have any suggestions for these kind of functions? I want to explicitly state that these functions are in some of namespace and are different of the other ones. In the end I don't think this is very harmful since these functions are one-time used (in a single place), is not the case that you have to use them everywhere.. > Those are just some high-level comments. This also needs some really > careful review of the refactoring to make sure that it doesn't break any > of the existing e820 users. > I'm glad to hear more people's thoughts on this. Thanks for the feedback.