From: Jimmy Shiu <jimmyshiu@google.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: mingo@redhat.com, joaodias@google.com, wvw@google.com,
Minchan Kim <minchan@google.com>,
Will McVicker <willmcvicker@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
Vlastimil Babka <vbabka@suse.cz>,
William Kucharski <william.kucharski@oracle.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Andreas Gruenbacher <agruenba@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] SCHED: attribute page lock and waitqueue functions as sched
Date: Fri, 5 Nov 2021 02:01:51 +0800 [thread overview]
Message-ID: <CAOnVMEE6s8DKuDb_zoh0kfpisA7t2OMd75LTM62NfXXbYRnuEQ@mail.gmail.com> (raw)
In-Reply-To: <YYLb2BGL1jR+kqF+@casper.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 5356 bytes --]
On Thu, Nov 4, 2021 at 2:59 AM Matthew Wilcox <willy@infradead.org> wrote:
> On Thu, Nov 04, 2021 at 02:47:03AM +0800, Jimmy Shiu wrote:
> > Bug: 144961676
> > Bug: 144713689
> > Bug: 172212772
>
> A bug number is meaningless without knowing which bug tracker they
> refer to. I suggest contemplating the meaning of the 'U' in URL.
>
> > Signed-off-by: Minchan Kim <minchan@google.com>
> > Signed-off-by: Jimmy Shiu <jimmyshiu@google.com>
> > (cherry picked from commit 1e4de875d9e0cfaccf5131bcc709ae8646cdc168)
>
> what tree is that commit ID in? I suggest it's meaningless and
> should be removed.
>
> > @@ -687,7 +688,7 @@ static inline void folio_lock(struct folio *folio)
> > /*
> > * lock_page may only be called if we have the page's inode pinned.
> > */
> > -static inline void lock_page(struct page *page)
> > +static inline __sched void lock_page(struct page *page)
>
> Why do you need to tag a static inline function as __sched? This would
> be the only place where that is done.
>
There's no guarantee that any function will be expanded inline.
Ex: I checked the System.map, the `folio_wait_bit_common` isn't expanded.
>
> > +++ b/kernel/sched/wait.c
> > @@ -404,7 +404,8 @@ void finish_wait(struct wait_queue_head *wq_head,
> struct wait_queue_entry *wq_en
> > }
> > EXPORT_SYMBOL(finish_wait);
> >
> > -int autoremove_wake_function(struct wait_queue_entry *wq_entry,
> unsigned mode, int sync, void *key)
> > +__sched int autoremove_wake_function(struct wait_queue_entry *wq_entry,
> unsigned int mode,
> > + int sync, void *key)
> > {
>
> This function doesn't sleep. Why does it need to be tagged __sched?
>
Right, I will remove this.
>
> > @@ -440,7 +441,7 @@ static inline bool is_kthread_should_stop(void)
> > * } smp_mb(); // C
> > * remove_wait_queue(&wq_head, &wait); wq_entry->flags |=
> WQ_FLAG_WOKEN;
> > */
> > -long wait_woken(struct wait_queue_entry *wq_entry, unsigned mode, long
> timeout)
> > +__sched long wait_woken(struct wait_queue_entry *wq_entry, unsigned int
> mode, long timeout)
>
> This one makes sense, but you've extended the length of the line past 80
> columns, and it seems like it should be a separate patch with its own
> justification.
>
OK, .let me create another patch for this.
>
> > +__sched int woken_wake_function(struct wait_queue_entry *wq_entry,
> unsigned int mode,
> > + int sync, void *key)
>
> This doesn't seem to sleep either?
>
Right, I will remove this.
>
> > +++ b/mm/filemap.c
> > @@ -1271,7 +1271,7 @@ static inline bool folio_trylock_flag(struct folio
> *folio, int bit_nr,
> > /* How many times do we accept lock stealing from under a waiter? */
> > int sysctl_page_lock_unfairness = 5;
> >
> > -static inline int folio_wait_bit_common(struct folio *folio, int bit_nr,
> > +static inline __sched int folio_wait_bit_common(struct folio *folio,
> int bit_nr,
> > int state, enum behavior behavior)
> > {
> > wait_queue_head_t *q = folio_waitqueue(folio);
> > @@ -1411,13 +1411,13 @@ static inline int folio_wait_bit_common(struct
> folio *folio, int bit_nr,
> > return wait->flags & WQ_FLAG_WOKEN ? 0 : -EINTR;
> > }
> >
> > -void folio_wait_bit(struct folio *folio, int bit_nr)
> > +__sched void folio_wait_bit(struct folio *folio, int bit_nr)
> > {
> > folio_wait_bit_common(folio, bit_nr, TASK_UNINTERRUPTIBLE, SHARED);
> > }
> > EXPORT_SYMBOL(folio_wait_bit);
> >
> > -int folio_wait_bit_killable(struct folio *folio, int bit_nr)
> > +__sched int folio_wait_bit_killable(struct folio *folio, int bit_nr)
> > {
> > return folio_wait_bit_common(folio, bit_nr, TASK_KILLABLE, SHARED);
> > }
> > @@ -1628,21 +1628,21 @@ EXPORT_SYMBOL_GPL(page_endio);
> > * __folio_lock - Get a lock on the folio, assuming we need to sleep to
> get it.
> > * @folio: The folio to lock
> > */
> > -void __folio_lock(struct folio *folio)
> > +__sched void __folio_lock(struct folio *folio)
> > {
> > folio_wait_bit_common(folio, PG_locked, TASK_UNINTERRUPTIBLE,
> > EXCLUSIVE);
> > }
> > EXPORT_SYMBOL(__folio_lock);
> >
> > -int __folio_lock_killable(struct folio *folio)
> > +__sched int __folio_lock_killable(struct folio *folio)
> > {
> > return folio_wait_bit_common(folio, PG_locked, TASK_KILLABLE,
> > EXCLUSIVE);
> > }
> > EXPORT_SYMBOL_GPL(__folio_lock_killable);
> >
> > -static int __folio_lock_async(struct folio *folio, struct
> wait_page_queue *wait)
> > +static __sched int __folio_lock_async(struct folio *folio, struct
> wait_page_queue *wait)
> > {
> > struct wait_queue_head *q = folio_waitqueue(folio);
> > int ret = 0;
> > @@ -1679,7 +1679,7 @@ static int __folio_lock_async(struct folio *folio,
> struct wait_page_queue *wait)
> > * If neither ALLOW_RETRY nor KILLABLE are set, will always return true
> > * with the folio locked and the mmap_lock unperturbed.
> > */
> > -bool __folio_lock_or_retry(struct folio *folio, struct mm_struct *mm,
> > +__sched bool __folio_lock_or_retry(struct folio *folio, struct
> mm_struct *mm,
> > unsigned int flags)
> > {
> > if (fault_flag_allow_retry_first(flags)) {
> > --
> > 2.34.0.rc0.344.g81b53c2807-goog
> >
> >
>
[-- Attachment #2: Type: text/html, Size: 8004 bytes --]
next prev parent reply other threads:[~2021-11-04 18:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 18:47 Jimmy Shiu
2021-11-03 18:58 ` Matthew Wilcox
2021-11-04 18:01 ` Jimmy Shiu [this message]
2021-11-03 19:10 ` Matthew Wilcox
2021-11-04 18:10 ` Jimmy Shiu
2021-11-04 9:16 ` Mel Gorman
2021-11-04 18:30 ` Jimmy Shiu
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=CAOnVMEE6s8DKuDb_zoh0kfpisA7t2OMd75LTM62NfXXbYRnuEQ@mail.gmail.com \
--to=jimmyshiu@google.com \
--cc=agruenba@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dhowells@redhat.com \
--cc=dietmar.eggemann@arm.com \
--cc=joaodias@google.com \
--cc=juri.lelli@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan@google.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vbabka@suse.cz \
--cc=vincent.guittot@linaro.org \
--cc=william.kucharski@oracle.com \
--cc=willmcvicker@google.com \
--cc=willy@infradead.org \
--cc=wvw@google.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