From: Alex Xu <email@example.com> To: Dan Streetman <firstname.lastname@example.org> Cc: Linux-MM <email@example.com>, linux-kernel <firstname.lastname@example.org> Subject: Re: [PATCH] mm: fix z3fold warnings on CONFIG_SMP=n Date: Thu, 27 Sep 2018 21:12:30 +0000 Message-ID: <email@example.com> (raw) In-Reply-To: <CALZtONA9r6=gnK-5a++tjaReqEnRzrBb3hzYMTFNXZ13z+UOWQ@mail.gmail.com> Quoting Dan Streetman (2018-09-27 20:41:21) > On Thu, Sep 27, 2018 at 4:27 PM Alex Xu (Hello71) <firstname.lastname@example.org> wrote: > > > > Spinlocks are always lockable on UP systems, even if they were just > > locked. > > i think it would be much better to just use either > assert_spin_locked() or just spin_is_locked(), instead of an #ifdef. > I wrote a longer response and then learned about the WARN_ON_SMP macro, so I'll just use that instead. Original response below: I thought about using assert_spin_locked, but I wanted to keep the existing behavior, and it seems to make sense to try to lock the page if we forgot to lock it earlier? Maybe not though; I don't understand this code completely. I did write a version of z3fold_page_ensure_locked with "if (assert_spin_locked(...))" but not only did that look even worse, it doesn't even work, because assert_spin_locked is a statement on UP systems, not an expression. It might be worth adding a ensure_spin_locked function that does that though... spin_is_locked currently still always returns 0 "on CONFIG_SMP=n builds with CONFIG_DEBUG_SPINLOCK=n", so that would just return us to the same problem of checking CONFIG_SMP.
next prev parent reply index Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-09-27 20:27 Alex Xu (Hello71) 2018-09-27 20:41 ` Dan Streetman 2018-09-27 21:12 ` Alex Xu [this message] 2018-09-27 21:15 ` [PATCH v2] " Alex Xu (Hello71) 2018-09-28 11:31 ` Dan Streetman
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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.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
LKML Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \ firstname.lastname@example.org public-inbox-index lkml Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git