public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Zhaoxiu Zeng <zengzhaoxiu@163.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Subject: Re: [PATCH 1/1] lib: use sunday algorithm to do strstr() and strnstr()
Date: Sat, 28 Jul 2018 16:38:38 +0200	[thread overview]
Message-ID: <20180728143838.GC3681@kroah.com> (raw)
In-Reply-To: <6b33eb08-b7f8-0104-4fe0-1c0f4cd5edfc@163.com>

On Sat, Jul 28, 2018 at 10:02:51PM +0800, Zhaoxiu Zeng wrote:
> 在 2018/7/27 18:39, Andy Shevchenko 写道:
> > On Fri, Jul 27, 2018 at 8:48 AM, Zhaoxiu Zeng <zengzhaoxiu@163.com> wrote:
> >> 在 2018/7/27 1:17, Zhaoxiu Zeng 写道:
> >>> 在 2018/7/23 2:37, Greg Kroah-Hartman 写道:
> >>>> On Mon, Jul 23, 2018 at 01:37:15AM +0800, Zhaoxiu Zeng wrote:
> > 
> >>>>> The Sunday algorithm is a variation of Boyer-Moore algorithm, it is easy and fast.
> >>>>> For the Sunday algorithm, to see
> >>>>>     http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/sundayen.htm
> >>>>
> >>>> So you say, but what does this really buy us?  Why make this change?
> >>>> How was it tested?  What is the downside of not taking this?
> > 
> >>> I use the following program to test on fc28.
> >>> Compile with O2, the new version is almost 2X faster than the original.
> > 
> >>> The code size of the original is 0x80, the newer is 0xB0.
> > 
> > So, output of bloat-o-meter would be good to have in commit message.
> > 
> >>> The test result:
> > 
> > Compact performance statistics as well.
> > 
> >>> Thanks!
> > 
> >> The original strnstr might has a bug too!
> >> For example, assume s1 is "123\0abc...." and s2 is "abc\0",
> >> call strnstr(s1, s2, 7) will return &s1[4], but the correct result is NULL.
> > 
> > If there is a bug, send another patch to fix the bug first.
> > 
> 
> The bug could be fixed by this patch.

Given that there doesn't seem to be a good reason to take your patch
yet, that might be hard :)

You need to convince us that the patch is a valid thing to accept, by
writing a correct changelog and showing proof of its correctness as this
is modifying a core function in the kernel.

thanks,

greg k-h

  reply	other threads:[~2018-07-28 14:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-22 17:37 [PATCH 1/1] lib: use sunday algorithm to do strstr() and strnstr() Zhaoxiu Zeng
2018-07-22 18:37 ` Greg Kroah-Hartman
2018-07-26 17:17   ` Zhaoxiu Zeng
2018-07-27  5:48     ` Zhaoxiu Zeng
2018-07-27 10:39       ` Andy Shevchenko
2018-07-28 14:02         ` Zhaoxiu Zeng
2018-07-28 14:38           ` Greg Kroah-Hartman [this message]
2018-07-29  7:37             ` Zhaoxiu Zeng

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=20180728143838.GC3681@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dan.carpenter@oracle.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=zengzhaoxiu@163.com \
    --cc=zhaoxiu.zeng@gmail.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