linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@redhat.com>, Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm/swapfile: fix swapoff vs. software dirty bits
Date: Fri, 18 Sep 2015 08:58:35 +0200	[thread overview]
Message-ID: <20150918085835.597fb036@mschwide> (raw)
In-Reply-To: <20150917193152.GJ2000@uranus>

On Thu, 17 Sep 2015 22:31:52 +0300
Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> Thus when CONFIG_MEM_SOFT_DIRTY = n, the unuse_pte will be the same
> as it were without the patch, calling pte_same.
> 
> Now to the bit itself
> 
> #ifdef CONFIG_MEM_SOFT_DIRTY
> #define _PAGE_SWP_SOFT_DIRTY_PAGE_PSE
> #else
> #define _PAGE_SWP_SOFT_DIRTY_PAGE_PSE(_AT(pteval_t, 0))
> #endif
>
> it's 0 if CONFIG_MEM_SOFT_DIRTY=n, so any setup of this
> bit will simply become nop

Ok, that is what I have been missing with my soft dirty patch for s390.
_PAGE_BIT_SOFT_DIRTY is always defined but the _PAGE_SOFT_DIRTY and
_PAGE_SWP_SOFT_DIRTY are conditional. The primitives are always
defined but turn into nops with CONFIG_MEM_SOFT_DIRTY=n.

> #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
> static inline pte_t pte_swp_mksoft_dirty(pte_t pte)
> {
> 	return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY);
> }
> 
> static inline int pte_swp_soft_dirty(pte_t pte)
> {
> 	return pte_flags(pte) & _PAGE_SWP_SOFT_DIRTY;
> }
> 
> static inline pte_t pte_swp_clear_soft_dirty(pte_t pte)
> {
> 	return pte_clear_flags(pte, _PAGE_SWP_SOFT_DIRTY);
> }
> #endif
> 
> So I fear I'm lost where this "set" of the bit comes from
> when CONFIG_MEM_SOFT_DIRTY=n.
> 
> Martin, could you please elaborate? Seems I'm missing
> something obvious.
 
It is me who missed something.. thanks for the explanation.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-09-18  6:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17  8:58 [PATCH] hanging swapoff with HAVE_ARCH_SOFT_DIRTY=y Martin Schwidefsky
2015-09-17  8:58 ` [PATCH] mm/swapfile: fix swapoff vs. software dirty bits Martin Schwidefsky
2015-09-17  9:53   ` Cyrill Gorcunov
2015-09-17 19:31   ` Cyrill Gorcunov
2015-09-18  6:58     ` Martin Schwidefsky [this message]
2015-09-18  7:15       ` Cyrill Gorcunov
2015-09-18  8:20         ` Martin Schwidefsky
2015-09-18  8:53           ` Cyrill Gorcunov
2015-09-18  9:10             ` Martin Schwidefsky
2015-09-18  9:28               ` Cyrill Gorcunov
2015-09-18 10:11                 ` Martin Schwidefsky
2015-09-18 20:21               ` Cyrill Gorcunov
2015-09-21  7:10                 ` Martin Schwidefsky
2015-09-21  7:30                   ` Cyrill Gorcunov
2015-09-21  7:40                     ` Martin Schwidefsky
2015-09-21  7:54                       ` Cyrill Gorcunov

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=20150918085835.597fb036@mschwide \
    --to=schwidefsky@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=gorcunov@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=mingo@redhat.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;
as well as URLs for NNTP newsgroup(s).