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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893C7C636CA for ; Wed, 21 Jul 2021 13:29:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 38CAF601FF for ; Wed, 21 Jul 2021 13:29:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38CAF601FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C98E76B0033; Wed, 21 Jul 2021 09:29:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C48E06B0036; Wed, 21 Jul 2021 09:29:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B10956B006C; Wed, 21 Jul 2021 09:29:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 8F3366B0033 for ; Wed, 21 Jul 2021 09:29:55 -0400 (EDT) Received: from forelay.prod.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by fograve04.hostedemail.com (Postfix) with ESMTP id 856E41849A for ; Wed, 21 Jul 2021 07:30:57 +0000 (UTC) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2F22D1854ADDE for ; Wed, 21 Jul 2021 07:30:57 +0000 (UTC) X-FDA: 78385773354.03.44DF675 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id AFDB1F0011C6 for ; Wed, 21 Jul 2021 07:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626852656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DL9UmkXz/nN7BSNL6vHyfX+JXbE4a1PMCoecBw8MQEw=; b=hmMYouoQ++abZQAvVdYK26Z2/6hqMiLQbJ5AYudxDbkctxqU0HZi91F/cc+HSNOqrdrvkq byq1/b5E+K06XdccxwVmkHy/mm9p1TCPhpnWERTapgIKR9muroEUgl+puMfDLQ2nUxhFIH lkNVteNbbhnEgxZbxw44nNp1jPHUOHQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-P4wYVQxwPGuVtZJaMzs2vg-1; Wed, 21 Jul 2021 03:30:53 -0400 X-MC-Unique: P4wYVQxwPGuVtZJaMzs2vg-1 Received: by mail-wm1-f70.google.com with SMTP id j141-20020a1c23930000b0290212502cb19aso235887wmj.0 for ; Wed, 21 Jul 2021 00:30:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=DL9UmkXz/nN7BSNL6vHyfX+JXbE4a1PMCoecBw8MQEw=; b=h7+ZdCzJE6iaab0uHRW1wFjD/9Y8Zwu3RP9vG/iQLaySLR6sX8ygmPl4JyTzmX17h/ J/Cy3YRJ7qSgXWYe+t1Rwn5u/hySvg+06Ei2Z2Nab49d8BXphe/LMTR/EKfkG07EDEQK d0s9NOdZJHUTwe+4gB5s9w3x33OA4peueHrNLb0k1ZOFNkkKF1wpqRm8A5VDU+VBbg0A brm0M8Nvxsh0EeBmv3sQPpvExPWdvA9IJIoroxpse1XJpaaVJBzgqg/fOV2aNCwKYDYd kz358fjHLg+eDhC4RBQv3B+ZonghkMAo1sl5khs7fgoX5FoffX7f1k1vKMGCIRP3xfDT bBYw== X-Gm-Message-State: AOAM532HvbzbyvFSsnJQLFXuM01NhN7pwNIuoBBbvsrW1/tnlCbrefR1 8W0qmRmme0OjfHz9cXKCX4EkeMAltYdAl8np1kcxuJjitWamejev1aP8ezkaOaaYqX0+oe4WmCL /hsL/poskhdE= X-Received: by 2002:adf:ea4c:: with SMTP id j12mr40199001wrn.138.1626852652694; Wed, 21 Jul 2021 00:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIQHk1P6w/MimNoqSTmY26cwLVNrhQ2aBrvQpPOB2x8VzbdDweeFLuPzs8IPbCNyR1oJy1uQ== X-Received: by 2002:adf:ea4c:: with SMTP id j12mr40198959wrn.138.1626852652444; Wed, 21 Jul 2021 00:30:52 -0700 (PDT) Received: from [192.168.3.132] (p5b0c65c3.dip0.t-ipconnect.de. [91.12.101.195]) by smtp.gmail.com with ESMTPSA id o14sm4391093wmq.31.2021.07.21.00.30.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jul 2021 00:30:51 -0700 (PDT) To: Andrew Morton Cc: Suren Baghdasaryan , mhocko@kernel.org, mhocko@suse.com, rientjes@google.com, willy@infradead.org, hannes@cmpxchg.org, guro@fb.com, riel@surriel.com, minchan@kernel.org, christian@brauner.io, hch@infradead.org, oleg@redhat.com, jannh@google.com, shakeelb@google.com, luto@kernel.org, christian.brauner@ubuntu.com, fweimer@redhat.com, jengelh@inai.de, timmurray@google.com, linux-api@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com References: <20210718214134.2619099-1-surenb@google.com> <7eb17da6-03a6-5eaf-16e6-97b53ba163d8@redhat.com> <20210720160707.2332738708948f7d865d67c1@linux-foundation.org> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v2 1/3] mm, oom: move task_will_free_mem up in the file to be used in process_mrelease Message-ID: Date: Wed, 21 Jul 2021 09:30:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210720160707.2332738708948f7d865d67c1@linux-foundation.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hmMYouoQ; spf=none (imf17.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-Stat-Signature: yijrz5dsunw6k6tw3cu8rix1rw5edf7p X-Rspamd-Queue-Id: AFDB1F0011C6 X-HE-Tag: 1626852656-413051 Content-Transfer-Encoding: quoted-printable 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 21.07.21 01:07, Andrew Morton wrote: > On Tue, 20 Jul 2021 14:43:52 +0200 David Hildenbrand = wrote: >=20 >> On 18.07.21 23:41, Suren Baghdasaryan wrote: >>> process_mrelease needs to be added in the CONFIG_MMU-dependent block = which >>> comes before __task_will_free_mem and task_will_free_mem. Move these >>> functions before this block so that new process_mrelease syscall can = use >>> them. >>> >>> Signed-off-by: Suren Baghdasaryan >>> --- >>> changes in v2: >>> - Fixed build error when CONFIG_MMU=3Dn, reported by kernel test robo= t. This >>> required moving task_will_free_mem implemented in the first patch >>> - Renamed process_reap to process_mrelease, per majority of votes >>> - Replaced "dying process" with "process which was sent a SIGKILL sig= nal" in >>> the manual page text, per Florian Weimer >>> - Added ERRORS section in the manual page text >>> - Resolved conflicts in syscall numbers caused by the new memfd_secre= t syscall >>> - Separated boilerplate code wiring-up the new syscall into a separat= e patch >>> to facilitate the review process >>> >>> mm/oom_kill.c | 150 +++++++++++++++++++++++++---------------------= ---- >>> 1 file changed, 75 insertions(+), 75 deletions(-) >> >> TBH, I really dislike this move as it makes git blame a lot harder wit= h >> any real benefit. >> >> Can't you just use prototypes to avoid the move for now in patch #2? >> >> static bool task_will_free_mem(struct task_struct *task); >=20 > This change makes the code better - it's silly to be adding forward > declarations just because the functions are in the wrong place. I'd really love to learn what "better" here means and if it's rather=20 subjective. When it comes to navigating the code, we do have established=20 tools for that (ctags), and personally I couldn't care less where=20 exactly in a file the code is located. Sure, ending up with a forward-declaration for every function might not=20 be what we want ;) >=20 > If that messes up git-blame then let's come up with better tooling > rather than suffering poorer kernel code because the tools aren't doing > what we want of them. Surely? I don't agree that what we get is "poorer kernel code" in this very=20 instance; I can understand that we avoid forward-declarations when=20 moving smallish functions. But moving two functions with 75 LOC is a bit=20 too much for my taste at least -- speaking as someone who cares about=20 easy backports and git-blame. Anyhow, just my 2 cents. --=20 Thanks, David / dhildenb