Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp80466rdb; Mon, 18 Dec 2023 09:23:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUKMmx8+FUsmoVUpVZAaFwPpkG6Ppwu66Kl+Mx3bdETut7XC7eV1P15A5/Ow7waV3bksFe X-Received: by 2002:ac8:7d81:0:b0:425:8b70:fdad with SMTP id c1-20020ac87d81000000b004258b70fdadmr24681220qtd.78.1702920238671; Mon, 18 Dec 2023 09:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702920238; cv=none; d=google.com; s=arc-20160816; b=S8FoXMSBNYZDvdvJBhzkI03bJivFLgOW5uKqJ8DtZHDpfsV0Ydxz7HI7/PSWj6NQHn 0cICs2UDr0fMTYh8zehJBKRzvx/LJlR9D/IIXRwGRKN4MnZTLvbznNS20lGFVhCKTq+w nFD88NVI9/wy62wEHRCAIsU945QJ/enbjBBLW6ETkc+OftAxKyr9ZF3qqtktuG9tHd0J mCAYTj04oNLdtPiBMAUuJcgDFTOsFWLz/W83zMAkYFBXR/3dgnj7kLXdOa09ovpfutf6 EYlx9SrMcu+lSKyZYsSwNyqZ26JSGhpJVUgVpbzkU/Pvr1V7yZHEHMUcCAZoaC6GEG9E chFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=4FVPYVORWJGonvEr9sz1J4Zu4cOx0k/Kj72phtX7TMY=; fh=jqCXb/T0Dmnd35zdet6EAh2olgEBNulES7wq+dbNoWs=; b=xooGHl3IK/+eZ6FZFeSTg5xUC1jwq0AijiH4wh0iiGSmyC55RS7nKGbIwst2FWOtLo o+y3a6a3jd4eMCrbJ+dAx6NcByNBLFzNO5tqSISLHO6z3Bjakt+hCi63DL/x8hYsoGYG nLrwU3Yk5DSQ2obhWEGHlFQXKxMx7cVlcVDfcoa+3lKDRz1NpQVsw6nO5ZaeG3I5WxcS G3FCMxr1qNtNwEJFKQLuJyyhk5KcHk55bvl9wlNfucJsviU2eD4rz5XYVGlLT4bzVwbQ SIpe7z9/MvZ1OP+UnWsZsRToiyoK1j4OpCvtvtaOPGyuQ7MclfNo0Qtq7NOAl7E3OqvH 90wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4158-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f16-20020a05622a1a1000b004239a83db71si25682652qtb.634.2023.12.18.09.23.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:23:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4158-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5DC4F1C23FC0 for ; Mon, 18 Dec 2023 17:23:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D07345D75F; Mon, 18 Dec 2023 17:23:32 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) (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 7A1C31E4A4; Mon, 18 Dec 2023 17:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="398319087" X-IronPort-AV: E=Sophos;i="6.04,286,1695711600"; d="scan'208";a="398319087" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 09:23:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="919334061" X-IronPort-AV: E=Sophos;i="6.04,286,1695711600"; d="scan'208";a="919334061" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 09:23:26 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rFHKt-0000000725r-1PQS; Mon, 18 Dec 2023 19:23:23 +0200 Date: Mon, 18 Dec 2023 19:23:23 +0200 From: Andy Shevchenko To: Nick Desaulniers Cc: Tanzir Hasan , Kees Cook , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Nick DeSaulniers , Andrew Morton , llvm@lists.linux.dev, Al Viro Subject: Re: [PATCH v2 1/2] sh: Added kernel.h to word-at-a-time Message-ID: References: <20231214-libstringheader-v2-0-0f195dcff204@google.com> <20231214-libstringheader-v2-1-0f195dcff204@google.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Dec 18, 2023 at 08:57:59AM -0800, Nick Desaulniers wrote: > On Fri, Dec 15, 2023 at 11:09 AM Andy Shevchenko > wrote: > > On Fri, Dec 15, 2023 at 8:31 PM Tanzir Hasan wrote: > > > On Fri, Dec 15, 2023 at 8:04 AM Andy Shevchenko wrote: > > >> On Thu, Dec 14, 2023 at 09:06:12PM +0000, tanzirh@google.com wrote: ... > > >> > +#include > > >> > > >> I highly discourage from doing that. Instead, split what is needed to > > >> the separate (new) header and include that one. > > > > > > > > > I think it would make the most sense to do this in a separate patch. > > > What word-at-a-time.h needs from kernel.h is REPEAT_BYTE and to my knowledge, > > > almost every other version of word-at-a-time.h includes kernel.h gets this by > > > including kernel.h. A future change could be removing REPEAT_BYTE > > > out of kernel.h > > > > Just create a patch that either moves that macro (along with upper_*() > > and lower_*() APIs) to a more distinguishable header > > (maybe bytes.h or words.h or wordpart.h, etc) and use it in your case > > and fix others. > > Andy, > These are good suggestions and we should do them... > > ...and Tanzir only has 3 weeks left of his internship. I don't want > him to get bogged down chasing build regressions from modifying the > headers themselves. I think what's best for him from here through the > remainder of his internship is to stay focused on applying suggestions > from IWYU to just modify the #include list of .c files, and not start > splitting .h files. Splitting the .h files will be the next step, and > is made easier by having the codebase not have so many indirect > includes (via IWYU), but we need time to soak header changes, and time > Tanzir does not have. Please can we keep the suggestions focused on > whether the modifications to the header includes (and the tangential > cleanups) are correct? Understood. Can we add a comment like /* FIXME: replace with a proper header to avoid dependency hell */ #include ? > While REPEAT_BYTE has a manageable number of users, upper_* and > lower_* have significantly more; I worry about moving those causing > regressions. If you look at how I did similar in the past, I back included new header into kernel.h. Not the pretty solution, but allows to split in the new code. > We can move them, but such changes would need significantly more soak time s/significantly// But I got your point, see above. > than this series IMO. Tanzir is also working on statistical analysis; I > suspect if he analyzes include/linux/kernel.h, he can comment on whether the > usage of REPEAT_BYTE is correlated with the usage of upper_* and lower_* in > order to inform whether they should be grouped together or not. -- With Best Regards, Andy Shevchenko