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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0790BC433EF for ; Sat, 2 Oct 2021 11:56:34 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web09.9845.1633175792935531401 for ; Sat, 02 Oct 2021 04:56:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L8QT6zg3; spf=pass (domain: gmail.com, ip: 209.85.167.50, mailfrom: nghialm78@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id x27so49524352lfu.5 for ; Sat, 02 Oct 2021 04:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KErbxHvPVdYW2PUdOpsmeeK72DV+p4hfHHQDE5GELqU=; b=L8QT6zg3V4wE2xUJ70+oClTrJcueFEWh32q04TKIxRfZgqbJnMe8ONEtdrU7tBmlDn lZzwurpHggCN2v3JR88hMPCMHe6WOcDiBR+8/GqKBdUBQsgrjW+ReBr2yuQeHcpRc1Rh dqoYWsLZGK8XurxbYubnQkMshhyNjDd+nydAQzMVdLFM22wDY6eu2tV0eISJkj6+mjXU CauFJNdnnb/VKt4/SvTNxEPqMZ7jl6FVBmB4nTVCfucLugDzba5Wk2I6qdnbRK4pidw3 c9iYkwew7llxLzXqzFUAuo5+0FoL8DhkmpKRXUTLkSMrq5J6ZJ1OT/QxyIm1FomgV8sf cDyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KErbxHvPVdYW2PUdOpsmeeK72DV+p4hfHHQDE5GELqU=; b=LECtKY8fVc/gr8RfjHSihrPqkX3/sY8wm71pgUqw32CKSSmOQkWBNSsGWBHbAJIztx 1594Dtl7mpiNP64denIJWkVN4xd6svEjf1UlnR+7u+alvvTdlDZzsgfW4yTaXeveSfdY T3E6HZqeWRi4/tDhkOYFidnbSe+MbscDW6mo95ufyrWiUGDvG1V/GvlS68RTszsXT8n/ xRGHOafMls7geTb7gwTIChIi8Gv+MH5LCdpZ/VpklcZGLYFH5vc7H9qyqRb8pAwsPQpb bAEMyUFrYOi8p1VXjmEULDpAp1YpBa96DivqWcS1c5ZEMdJEub3K5W5nF60FJzgBXi1k 7INQ== X-Gm-Message-State: AOAM533yniiY61TrqOlxLfWo/cJy7GdqtACSkk3JxCa5fHvOxqorZ7FV dclIbojjNE6VYlTzkisOUQ8csUnzwnNVmYr+5C0= X-Google-Smtp-Source: ABdhPJwr1p2d+1DdlMg98LVCVJMRP8EkXgWR/MCVnGln3ma+A8ywoxviwnNGkmLwqJtieXzmNEo59ruoJzST7B8aQpk= X-Received: by 2002:a05:6512:3e03:: with SMTP id i3mr3667068lfv.374.1633175790720; Sat, 02 Oct 2021 04:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20211001175732.75170-1-nghialm78@gmail.com> In-Reply-To: From: Nghia Le Date: Sat, 2 Oct 2021 18:56:20 +0700 Message-ID: Subject: Re: [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show() To: Lukas Bulwahn Cc: linux-safety@lists.elisa.tech Content-Type: multipart/alternative; boundary="000000000000dc991805cd5d5e93" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 02 Oct 2021 11:56:34 -0000 X-Groupsio-URL: https://lists.elisa.tech/g/linux-safety/message/250 --000000000000dc991805cd5d5e93 Content-Type: text/plain; charset="UTF-8" Dear Lukas, Thank you for detailed comments as well as your help. Patch v2 is ready for next review. Best regards, Nghia Le On Sat, Oct 2, 2021 at 12:14 PM Lukas Bulwahn wrote: > Just some minor improvements for the language: > > On Fri, Oct 1, 2021 at 7:57 PM Nghia Le wrote: > > > > Deadstore was detected by CodeCheck tool (ELISA group) > > Hints: > - Use active instead of passive tense > - It is detected by "make clang-analyzer". The CodeChecker tool is > just the webUI frontend. > - Dead store is written as two words (with a space between dead and > store). > > So, make it: > The command "make clang-analyzer" detected a dead store. > > > > > Removed demote_size and relevant assignment in function > demote_size_show() > > to fix deadstore issue of which stored value to demote_size is never read > > > > Hints: > - Use imperative form. > - ... and just some better English grammar. > > So make it: > Remove demote_size and corresponding assignment in function > demote_size_show() > to fix dead store, as demote_size is never read. > > Also change deadstore to dead store in subject. > > Other than that, it looks good to me. > > Send a PATCH v2 here. Then, we check again and you can send the patch > out to the maintainers. > > Lukas > > > Signed-off-by: Nghia Le > > --- > > mm/hugetlb.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > > index 993efa70bce4..ef00e6ad0f6a 100644 > > --- a/mm/hugetlb.c > > +++ b/mm/hugetlb.c > > @@ -3706,11 +3706,9 @@ static ssize_t demote_size_show(struct kobject > *kobj, > > struct kobj_attribute *attr, > char *buf) > > { > > struct hstate *h; > > - unsigned long demote_size; > > int nid; > > > > h = kobj_to_hstate(kobj, &nid); > > - demote_size = h->demote_order; > > > > return sysfs_emit(buf, "%lukB\n", > > (unsigned long)(PAGE_SIZE << h->demote_order) / > SZ_1K); > > -- > > 2.25.1 > > > --000000000000dc991805cd5d5e93 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Lukas,
Thank you for detailed comments as well as= your help. Patch v2 is ready for next review.
Best regards,
Nghia Le

On Sat, Oct 2, 2021 at 12:14 PM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote= :
Just some mino= r improvements for the language:

On Fri, Oct 1, 2021 at 7:57 PM Nghia Le <nghialm78@gmail.com> wrote:
>
> Deadstore was detected by CodeCheck tool (ELISA group)

Hints:
=C2=A0 - Use active instead of passive tense
=C2=A0 - It is detected by "make clang-analyzer". The CodeChecker= tool is
just the webUI frontend.
=C2=A0 - Dead store is written as two words (with a space between dead and = store).

So, make it:
The command "make clang-analyzer" detected a dead store.

>
> Removed demote_size and relevant assignment in function demote_size_sh= ow()
> to fix deadstore issue of which stored value to demote_size is never r= ead
>

Hints:
=C2=A0 - Use imperative form.
=C2=A0 - ... and just some better English grammar.

So make it:
Remove demote_size and corresponding assignment in function demote_size_sho= w()
to fix dead store, as demote_size is never read.

Also change deadstore to dead store in subject.

Other than that, it looks good to me.

Send a PATCH v2 here. Then, we check again and you can send the patch
out to the maintainers.

Lukas

> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> ---
>=C2=A0 mm/hugetlb.c | 2 --
>=C2=A0 1 file changed, 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 993efa70bce4..ef00e6ad0f6a 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3706,11 +3706,9 @@ static ssize_t demote_size_show(struct kobject = *kobj,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0struct kobj_attribute *attr, char *buf)
>=C2=A0 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hstate *h;
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned long demote_size;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nid;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0h =3D kobj_to_hstate(kobj, &nid);=
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0demote_size =3D h->demote_order;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return sysfs_emit(buf, "%lukB\n&= quot;,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(unsigned long)(PAGE_SIZE << h->demote_order) = / SZ_1K);
> --
> 2.25.1
>
--000000000000dc991805cd5d5e93-- 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 706EFC433F5 for ; Sat, 2 Oct 2021 11:56:34 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF7B061AED for ; Sat, 2 Oct 2021 11:56:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EF7B061AED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id N77nYY5279335x9IedIfRsgl; Sat, 02 Oct 2021 04:56:33 -0700 X-Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web09.9845.1633175792935531401 for ; Sat, 02 Oct 2021 04:56:33 -0700 X-Received: by mail-lf1-f50.google.com with SMTP id x27so49524352lfu.5 for ; Sat, 02 Oct 2021 04:56:32 -0700 (PDT) X-Gm-Message-State: 6jhNGbRk49S0ZV8IEBwmpSUbx5278000AA= X-Google-Smtp-Source: ABdhPJwr1p2d+1DdlMg98LVCVJMRP8EkXgWR/MCVnGln3ma+A8ywoxviwnNGkmLwqJtieXzmNEo59ruoJzST7B8aQpk= X-Received: by 2002:a05:6512:3e03:: with SMTP id i3mr3667068lfv.374.1633175790720; Sat, 02 Oct 2021 04:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20211001175732.75170-1-nghialm78@gmail.com> In-Reply-To: From: "Nghia Le" Date: Sat, 2 Oct 2021 18:56:20 +0700 Message-ID: Subject: Re: [linux-safety] [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show() To: Lukas Bulwahn Cc: linux-safety@lists.elisa.tech Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech List-Post: Content-Type: multipart/alternative; boundary="000000000000dc991805cd5d5e93" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1633175793; bh=1jNN5Y3uIvq2xjTd11x0J+keqyUmQa6iVXjXPVOXd+0=; h=Cc:Content-Type:Date:From:Subject:To; b=sx0X9ISPTc6rW/eCs3kqPUCx1Gx/XMaIWZEuGKwLI3JKlgDoV79xPCIItVA/Q/FtLVA /5ZeF/flp+x7ZTXOwejSo3Acz4ShdsyBOZWB/MRw1KlCBGN1bQBxezkf+X+6EVA7MKJP8 2RnTgq+wRlyDDyujJ4yhD9nTKzk1XvK2/r4= Message-ID: <20211002115620.mIpFX1YH0pCC3Le2FFbkOMbWIsZXfEpuT1sbzU1__ng@z> --000000000000dc991805cd5d5e93 Content-Type: text/plain; charset="UTF-8" Dear Lukas, Thank you for detailed comments as well as your help. Patch v2 is ready for next review. Best regards, Nghia Le On Sat, Oct 2, 2021 at 12:14 PM Lukas Bulwahn wrote: > Just some minor improvements for the language: > > On Fri, Oct 1, 2021 at 7:57 PM Nghia Le wrote: > > > > Deadstore was detected by CodeCheck tool (ELISA group) > > Hints: > - Use active instead of passive tense > - It is detected by "make clang-analyzer". The CodeChecker tool is > just the webUI frontend. > - Dead store is written as two words (with a space between dead and > store). > > So, make it: > The command "make clang-analyzer" detected a dead store. > > > > > Removed demote_size and relevant assignment in function > demote_size_show() > > to fix deadstore issue of which stored value to demote_size is never read > > > > Hints: > - Use imperative form. > - ... and just some better English grammar. > > So make it: > Remove demote_size and corresponding assignment in function > demote_size_show() > to fix dead store, as demote_size is never read. > > Also change deadstore to dead store in subject. > > Other than that, it looks good to me. > > Send a PATCH v2 here. Then, we check again and you can send the patch > out to the maintainers. > > Lukas > > > Signed-off-by: Nghia Le > > --- > > mm/hugetlb.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > > index 993efa70bce4..ef00e6ad0f6a 100644 > > --- a/mm/hugetlb.c > > +++ b/mm/hugetlb.c > > @@ -3706,11 +3706,9 @@ static ssize_t demote_size_show(struct kobject > *kobj, > > struct kobj_attribute *attr, > char *buf) > > { > > struct hstate *h; > > - unsigned long demote_size; > > int nid; > > > > h = kobj_to_hstate(kobj, &nid); > > - demote_size = h->demote_order; > > > > return sysfs_emit(buf, "%lukB\n", > > (unsigned long)(PAGE_SIZE << h->demote_order) / > SZ_1K); > > -- > > 2.25.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#250): https://lists.elisa.tech/g/linux-safety/message/250 Mute This Topic: https://lists.elisa.tech/mt/86006510/5278000 Group Owner: linux-safety+owner@lists.elisa.tech Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org] -=-=-=-=-=-=-=-=-=-=-=- --000000000000dc991805cd5d5e93 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Lukas,
Thank you for detailed comments as well as= your help. Patch v2 is ready for next review.
Best regards,
Nghia Le

On Sat, Oct 2, 2021 at 12:14 PM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote= :
Just some mino= r improvements for the language:

On Fri, Oct 1, 2021 at 7:57 PM Nghia Le <nghialm78@gmail.com> wrote:
>
> Deadstore was detected by CodeCheck tool (ELISA group)

Hints:
=C2=A0 - Use active instead of passive tense
=C2=A0 - It is detected by "make clang-analyzer". The CodeChecker= tool is
just the webUI frontend.
=C2=A0 - Dead store is written as two words (with a space between dead and = store).

So, make it:
The command "make clang-analyzer" detected a dead store.

>
> Removed demote_size and relevant assignment in function demote_size_sh= ow()
> to fix deadstore issue of which stored value to demote_size is never r= ead
>

Hints:
=C2=A0 - Use imperative form.
=C2=A0 - ... and just some better English grammar.

So make it:
Remove demote_size and corresponding assignment in function demote_size_sho= w()
to fix dead store, as demote_size is never read.

Also change deadstore to dead store in subject.

Other than that, it looks good to me.

Send a PATCH v2 here. Then, we check again and you can send the patch
out to the maintainers.

Lukas

> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> ---
>=C2=A0 mm/hugetlb.c | 2 --
>=C2=A0 1 file changed, 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 993efa70bce4..ef00e6ad0f6a 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3706,11 +3706,9 @@ static ssize_t demote_size_show(struct kobject = *kobj,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0struct kobj_attribute *attr, char *buf)
>=C2=A0 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hstate *h;
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned long demote_size;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nid;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0h =3D kobj_to_hstate(kobj, &nid);=
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0demote_size =3D h->demote_order;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return sysfs_emit(buf, "%lukB\n&= quot;,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(unsigned long)(PAGE_SIZE << h->demote_order) = / SZ_1K);
> --
> 2.25.1
>
_._,_._,_

L= inks:

You receive all messages sent to this group.

View/= Reply Online (#250) | Re= ply To Sender | Reply To = Group | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [linux-saf= ety@archiver.kernel.org]

_._,_._,_
=20 --000000000000dc991805cd5d5e93--