Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp336985ybk; Fri, 15 May 2020 01:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY9lOXyVUKbFR5itr6LrO3v0QWvEqWMxSQeftZMlqiKegbVeyxo6y+uPx0MaCrL58zypvD X-Received: by 2002:a17:906:8611:: with SMTP id o17mr1696738ejx.221.1589533129217; Fri, 15 May 2020 01:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589533129; cv=none; d=google.com; s=arc-20160816; b=Z8bligO/KxS6muK/BUPIjp7mjZ73GoA1LAcDVzCJ508WDPfedEG0/3hlu4pek9VtPj ZwHJagm0BZX+ffhNcMPQMODpL308rwuJ6Y5aQ3Jhizv8CQygota57He6pYHZ/y4ks6o8 KN1X0c2B3EHmZ8PPvYqgogBum3KwPdycwyQ2A7Nw9yIAQ5mXNvy1BpCU9c520JlhLBjp UxuqfxHcRmSxsbNpTgAoLRkG9BOjNt5ruKRWeu2W6h+RUa+ZeTWb0qPqHbacP6MKwagv JR8l77da+w6P364QP6xjdahSucZCHBfu7JNLWOnFTh7uBm0+K2oRfK/6YAUJTRkxZJi2 28BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=TxpwLLMD589zX0kuBORIdEhtl+jxcG5wwqrJxhhvz7U=; b=EgDleTk4R1j+KEe9Sgf5VlSELpw9eUWhbTVpv52RoGpBc7bHx4EtlQ7TnZrYkuzoW7 mAgptjMYLRfGbgcZJQIWlC4lgWsRiquM17o+HqhX9SIZa+wohauwLx99KYoI1DxtDJCV D2L77fG9+tJcMpGQk0ONTKTWC2UCdeGc7WihyBQH1TaGlSeW0HPZl1vvvBkLyBjWNVIf uVEsw0WO1yze16Ze7aX/O32lTpTGLOvPumNYFbE3jhXXdeHZlzUAx409xa5GexftwqzB HQih9CMM7FlgFSwHeyrbcB550lHa5mBfi4VL9kM+59VfOQ93zhkkQ9Ov7qbUR6iyRZ6n ktNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck13si796727ejb.403.2020.05.15.01.58.24; Fri, 15 May 2020 01:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727829AbgEOI4y (ORCPT + 99 others); Fri, 15 May 2020 04:56:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:44076 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726922AbgEOI4y (ORCPT ); Fri, 15 May 2020 04:56:54 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DBAF970E520CAE57BCD2; Fri, 15 May 2020 16:56:51 +0800 (CST) Received: from [127.0.0.1] (10.67.102.197) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 15 May 2020 16:56:44 +0800 Subject: Re: [PATCH 1/4] hung_task: Move hung_task sysctl interface to hung_task_sysctl.c To: Kees Cook CC: , , , , , , , , , , , , , , , , , , , References: <1589517224-123928-1-git-send-email-nixiaoming@huawei.com> <1589517224-123928-2-git-send-email-nixiaoming@huawei.com> <202005150103.6DD6F07@keescook> From: Xiaoming Ni Message-ID: Date: Fri, 15 May 2020 16:56:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <202005150103.6DD6F07@keescook> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.197] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/15 16:04, Kees Cook wrote: > On Fri, May 15, 2020 at 12:33:41PM +0800, Xiaoming Ni wrote: >> Move hung_task sysctl interface to hung_task_sysctl.c. >> Use register_sysctl() to register the sysctl interface to avoid >> merge conflicts when different features modify sysctl.c at the same time. >> >> Signed-off-by: Xiaoming Ni >> --- >> include/linux/sched/sysctl.h | 8 +---- >> kernel/Makefile | 4 ++- >> kernel/hung_task.c | 6 ++-- >> kernel/hung_task.h | 21 ++++++++++++ >> kernel/hung_task_sysctl.c | 80 ++++++++++++++++++++++++++++++++++++++++++++ > > Why a separate file? That ends up needing changes to Makefile, the > creation of a new header file, etc. Why not just put it all into > hung_task.c directly? > > -Kees > But Luis Chamberlain's suggestion is to put the hung_task sysctl code in a separate file. Details are in https://lkml.org/lkml/2020/5/13/762. I am a little confused, not sure which way is better. Thanks Xiaoming Ni