> -----Original Message----- > From: Yosry Ahmed <yosryahmed@xxxxxxxxxx> > Sent: Thursday, September 26, 2024 11:46 AM > To: Johannes Weiner <hannes@xxxxxxxxxxx> > Cc: Sridhar, Kanchana P <kanchana.p.sridhar@xxxxxxxxx>; linux- > kernel@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx; nphamcs@xxxxxxxxx; > chengming.zhou@xxxxxxxxx; usamaarif642@xxxxxxxxx; > shakeel.butt@xxxxxxxxx; ryan.roberts@xxxxxxx; Huang, Ying > <ying.huang@xxxxxxxxx>; 21cnbao@xxxxxxxxx; akpm@xxxxxxxxxxxxxxxxxxxx; > Zou, Nanhai <nanhai.zou@xxxxxxxxx>; Feghali, Wajdi K > <wajdi.k.feghali@xxxxxxxxx>; Gopal, Vinodh <vinodh.gopal@xxxxxxxxx> > Subject: Re: [PATCH v7 6/8] mm: zswap: Support mTHP swapout in > zswap_store(). > > On Thu, Sep 26, 2024 at 11:43 AM Johannes Weiner <hannes@xxxxxxxxxxx> > wrote: > > > > On Thu, Sep 26, 2024 at 05:29:30PM +0000, Sridhar, Kanchana P wrote: > > > > > 3) Keep the approach in v7 where obj_cgroup_get/put is localized to > > > > > zswap_store_page for both success and error conditions, and any > > > > unwinding > > > > > state in zswap_store will take care of dropping references obtained > from > > > > > prior successful writes (from this or prior invocations of > zswap_store). > > > > > > > > I am also fine with doing that and doing the reference batching as a > follow up. > > > > > > I think so too! We could try and improve upon (3) with reference batching > > > in a follow-up patch. > > > > Yeah, I agree. The percpu-refcounts are not that expensive, we should > > be able to live with per-page ops for now. > > > > One thing you *can* do from the start is tryget a pool reference in > > zswap_store(), to prevent the pools untimely demise while you work on > > it, and then in zswap_store_page() you can do gets instead of trygets. > > > > You'd have to rename zswap_pool_get() to zswap_pool_tryget() (which is > > probably for the best) and implement the trivial new zswap_pool_get(). > > Yeah I was actually planning to send a follow-up patch to do exactly > that until we figure out proper patching for the refcounts. Even > better if Kanchana incorporates it in the next version :) Sure, Yosry, I will incorporate it in the next version! Thanks again, Kanchana