linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zi Yan" <ziy@nvidia.com>
To: "kernel test robot" <lkp@intel.com>
Cc: "Zi Yan" <zi.yan@sent.com>,
	linux-mm@kvack.org, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Sandipan Das" <sandipan@linux.ibm.com>,
	"David Hildenbrand" <david@redhat.com>
Subject: Re: [PATCH v4 1/2] mm: huge_memory: a new debugfs interface for splitting THP tests.
Date: Mon, 15 Mar 2021 21:10:08 -0400	[thread overview]
Message-ID: <F969CAE6-AEC4-4FEE-A200-74110A042C8D@nvidia.com> (raw)
In-Reply-To: <202103160807.JLJ4NOSP-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2537 bytes --]

On 15 Mar 2021, at 20:36, kernel test robot wrote:

> Hi Zi,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on kselftest/next]
> [also build test WARNING on linux/master linus/master v5.12-rc3]
> [cannot apply to hnaz-linux-mm/master next-20210315]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
>
> url:    https://github.com/0day-ci/linux/commits/Zi-Yan/mm-huge_memory-a-new-debugfs-interface-for-splitting-THP-tests/20210316-043528
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
> config: i386-randconfig-m021-20210315 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> smatch warnings:
> mm/huge_memory.c:3086 split_huge_pages_write() warn: sscanf doesn't return error codes
>
> vim +3086 mm/huge_memory.c
>
>   3051	
>   3052	static ssize_t split_huge_pages_write(struct file *file, const char __user *buf,
>   3053					size_t count, loff_t *ppops)
>   3054	{
>   3055		static DEFINE_MUTEX(mutex);
>   3056		ssize_t ret;
>   3057		char input_buf[80]; /* hold pid, start_vaddr, end_vaddr */
>   3058		int pid;
>   3059		unsigned long vaddr_start, vaddr_end;
>   3060	
>   3061		ret = mutex_lock_interruptible(&mutex);
>   3062		if (ret)
>   3063			return ret;
>   3064	
>   3065		ret = -EFAULT;
>   3066	
>   3067		memset(input_buf, 0, 80);
>   3068		if (copy_from_user(input_buf, buf, min_t(size_t, count, 80)))
>   3069			goto out;
>   3070	
>   3071		input_buf[79] = '\0';
>   3072		ret = sscanf(input_buf, "%d,0x%lx,0x%lx", &pid, &vaddr_start, &vaddr_end);
>   3073		if (ret == 1 && pid == 1) {
>   3074			split_huge_pages_all();
>   3075			ret = strlen(input_buf);
>   3076			goto out;
>   3077		} else if (ret != 3) {
>   3078			ret = -EINVAL;
>   3079			goto out;
>   3080		}
>   3081	
>   3082		if (!split_huge_pages_pid(pid, vaddr_start, vaddr_end))
>   3083			ret = strlen(input_buf);

Change this to:

ret = split_huge_pages_pid(pid, vaddr_start, vaddr_end);
if (!ret)
	ret = strlen(input_buf);

should fix the warning. I will resend after I get feedback for the patches.


>   3084	out:
>   3085		mutex_unlock(&mutex);
>> 3086		return ret;
>   3087	





—
Best Regards,
Yan Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

  reply	other threads:[~2021-03-16  1:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 20:33 Zi Yan
2021-03-15 20:33 ` [PATCH v4 2/2] mm: huge_memory: debugfs for file-backed THP split Zi Yan
2021-03-16 23:18   ` Yang Shi
2021-03-17 15:00     ` Zi Yan
2021-03-17 16:34       ` Yang Shi
2021-03-16  0:36 ` [PATCH v4 1/2] mm: huge_memory: a new debugfs interface for splitting THP tests kernel test robot
2021-03-16  1:10   ` Zi Yan [this message]
2021-03-16 22:23 ` Yang Shi
2021-03-17 14:51   ` Zi Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F969CAE6-AEC4-4FEE-A200-74110A042C8D@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=sandipan@linux.ibm.com \
    --cc=skhan@linuxfoundation.org \
    --cc=zi.yan@sent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox