linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hillf Danton <hdanton@sina.com>, linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Michal Hocko <mhocko@suse.com>,
	Shakeel Butt <shakeelb@google.com>,
	Minchan Kim <minchan@kernel.org>, Mel Gorman <mgorman@suse.de>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Jan Kara <jack@suse.cz>
Subject: Re: [RFC v2] mm: add page preemption
Date: Tue, 29 Oct 2019 11:04:18 +0800	[thread overview]
Message-ID: <20191029030418.18624-1-hdanton@sina.com> (raw)
In-Reply-To: <20191026112808.14268-1-hdanton@sina.com>


Date: Mon, 28 Oct 2019 11:56:17 -0400 Johannes Weiner wrote:
> 
> On Sat, Oct 26, 2019 at 07:28:08PM +0800, Hillf Danton wrote:
> > 
> > The cpu preemption feature makes a task able to preempt other tasks
> > of lower priorities for cpu. It has been around for a while.
> > 
> > This work introduces task prio into page reclaiming in order to add
> > the page preemption feature that makes a task able to preempt other
> > tasks of lower priorities for page.
> > 
> > No page will be reclaimed on behalf of tasks of lower priorities
> 
> ... at which point they'll declare OOM and kill the high-pri task?

Fixed. Thanks.

--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -164,6 +164,11 @@ static bool oom_unkillable_task(struct t
 		return true;
 	if (p->flags & PF_KTHREAD)
 		return true;
+
+#ifdef CONFIG_PAGE_PREEMPTION
+	if (p->prio < current->prio)
+		return true;
+#endif
 	return false;
 }
 
--


> Please have a look at the cgroup2 memory.low control. This memory
> prioritization problem has already been solved.

Scooter never runs in subway. Fixed.

--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -197,8 +198,18 @@ struct page {
 	/* Usage count. *DO NOT USE DIRECTLY*. See page_ref.h */
 	atomic_t _refcount;
 
+	/* 32/56 bytes above */
+
 #ifdef CONFIG_MEMCG
 	struct mem_cgroup *mem_cgroup;
+#else
+#ifdef CONFIG_64BIT
+	union {
+		int prio;
+		void *__pad;
+	};
+#define CONFIG_PAGE_PREEMPTION PP
+#endif
 #endif
 
 	/*
--



  parent reply	other threads:[~2019-10-29  3:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26 11:28 Hillf Danton
2019-10-28 12:26 ` Kirill A. Shutemov
2019-10-28 13:55 ` Hillf Danton
2019-10-28 15:56 ` Johannes Weiner
2019-10-29  3:04 ` Hillf Danton [this message]
2019-10-29  8:41 ` Michal Hocko
2019-10-29 15:27   ` Johannes Weiner
2019-10-29 12:30 ` Hillf Danton
2019-10-29 13:26   ` David Hildenbrand
2019-10-29 13:41     ` Michal Hocko

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=20191029030418.18624-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=jack@suse.cz \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=shakeelb@google.com \
    --cc=vdavydov.dev@gmail.com \
    --cc=willy@infradead.org \
    /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