Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / design.md
Last active April 4, 2023 11:35
Degraded Lvols

Logical Volumes with Missing External Snapshots

The original design of external snapshots allows esnap clone lvols to successfully open before the external snapshot is present. A logical volume with a missing external snapshot is referred to as degraded. It was done this way because:

  1. It is hard for the SPDK administrator to control the order that examine_config callbacks will be called.
  2. The consumer of an esnap clone may not actually need to perform reads from the external snapshot because the clusters containing the requested blocks may have already been allocated in the esnap clone's blob.
  3. Esnap clones may be at the root of a deep tree of snapshots and clones. It would be complex to delay the online of all of these until the external snapshot is available.
  4. Immediate registration of bdevs simplifies management of degraded lvols.
    1. bdev_get_bdevs allows degraded lvols to be seen. The module-specific section indicates when it is degraded.
  5. bdev_lvol_delete allows degraded esnap c
@mgerdts
mgerdts / gerrit-margin-fix.js
Created February 13, 2023 05:05
Workaround for Gerrit bug 16113
// ==UserScript==
// @name Gerrit margin fix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Workaround https://bugs.chromium.org/p/gerrit/issues/detail?id=16113
// @author Mike Gerdts <[email protected]>
// @match https://*/gerrit/q/*
// @match https://*/gerrit/dashboard/self
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant none
@mgerdts
mgerdts / README.md
Last active January 24, 2023 17:15
SPDK check_so_ver tests

Configure abi test builds

In a checked out spdk repo:

. test/common/config/pkgdep/git
INSTALL_REFSPDK=true install_sources

After this, two new directories should exist:

@mgerdts
mgerdts / README.md
Created January 23, 2023 18:29
Prevent accidental squash during merge fixup

I've found that git rebase -i $some_commit and adding break lines is very handy for fixing up things in an earlier commits. I then sometimes use x ./check after each subsequent commit to quickly identify any breakage in the commit where it happens.

After each fixup due to break or x, I need to run:

git commit --amend -a
git rebase --continue

If the rebase stops because there is a merge conflict that I need to fix, the proper thing to do is:

@mgerdts
mgerdts / pathodon.md
Created November 25, 2022 05:32
Pathodon idea

Pathodon

This is a proposal for a social network optimized for hiking, walking, trekking and other forms of ambling through nature. It is intended to be a participant in ActivityPub Fediverse. In particular, things shared on Pathodon should look great on Mastodon and Mastodon users should be able to interact with Pathodon users as naturally as they the interact with other Mastodon users.

The key things that set Pathodon apart from Mastodon are:

  • Support GPS traces (e.g. GPX) to let others know about trails and to be able to follow others in a very literal sense.
  • Encourage the use of consistent, geographically significant hashtags for meaningful follows.
  • Geographic search to find recent activity in a region of interest
  • Use of OpenStreetMap (OSM) and curation of trails and related OSM data.

This originally appeared in this slack message.

I've implemented your latest suggestions, which I think will work out ok. I'll push to gerrit shortly. I also hacked up a version to compare mutex and spinlock performance. With each thread taking the lock 50,000 times, the mutex takes 4% longer (non-debug, no asan, no ubsan) when the threads get fair access to the lock.

Starting test contend_spin
  Worker    Delay  Wait us  Hold us Total us
       0        3   251971   153829   405801
       1        5   151200   253713   404914
PASS test contend_spin

Blobstore External Snapshots Design {#blob_esnap_design}

Terminology

External snapshots provide a way for a blob to be a clone of storage that exists outside of the blobstore. This document describes the design of this feature.

X-Gmail-Received: cd1f5334be7e07c5ae660415a92dd8d7db52e9a8
Delivered-To: [email protected]
Received: by 10.90.82.20 with SMTP id f20cs699047agb;
Mon, 11 Sep 2006 16:46:36 -0700 (PDT)
Received: by 10.70.46.1 with SMTP id t1mr7121092wxt;
Mon, 11 Sep 2006 16:46:15 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mail.opensolaris.org (oss-mail1.opensolaris.org [72.5.123.71])
by mx.gmail.com with ESMTP id h18si9496273wxd.2006.09.11.16.46.08;
Mon, 11 Sep 2006 16:46:15 -0700 (PDT)

This describes Mike Gerdts' suggestion for how to complete the work on OS-6632. It is an expansion of this comment.

Overview

The OS-6632 branch has a prototype fix that demonstrates that it is possible for the guest to recognize disk size changes when a zvol changes size. To detect the size change, the bhyve process has an mevent that fstat()s each virtio-blk device

@mgerdts
mgerdts / README.md
Last active February 19, 2020 15:56

This records my configuration of a host used for Linux CN development. The host is a relatively current Intel box with 64 GiB of RAM. It is running Fedora 30.

Virtualization on the host

QEMU/KVM

I had initially gone down the route of using QEMU/KVM and this worked pretty well except:

  • SmartOS CNs were unable to run bhyve instances. This is problematic for testing unrelated to the Linux CN project.
  • debian-live CNs were unable to use MACVLAN in their nspawn configuration to bridge to my office network. Watching traffic generated by the container using MACVLAN, I could see that DHCP requests would make it to the DHCP server. The responses were seen on the Fedora 30 host but not in the debian-live guest. No amount of mucking about or googling lead to a solution.